代码之家  ›  专栏  ›  技术社区  ›  Shree Krishna

cardcornerradius在cardview中在android pie中看起来很奇怪

  •  2
  • Shree Krishna  · 技术社区  · 7 年前

    </style>

    但是在

     <style name="translucentCard" parent="CardView">
            <item name="cardCornerRadius">20dp</item>
            <item name="cardBackgroundColor">#26ffffff</item>
     </style>
    

    cardBackgroundColor

    3 回复  |  直到 7 年前
        1
  •  2
  •   Shree Krishna    7 年前

    最新版本上的向后兼容提升

    app:cardElevation="0dp"
    

    <item name="cardElevation">0dp</item>
    
        2
  •  0
  •   sandeep kolhal    7 年前

    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:id="@+id/rootView"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical"
    tools:context="...">
    
    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="center"
        android:gravity="center"
        android:text="..." />
    
    <android.support.v7.widget.CardView
        android:layout_width="match_parent"
        style="@style/translucentCard"
        android:layout_marginTop="@dimen/activity_vertical_margin"
        android:layout_height="wrap_content">
    
        <LinearLayout
            style="@style/paddedContainer"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:background="@android:color/transparent"
            android:orientation="vertical">
    
            <android.support.design.widget.TextInputLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:hint="@string/login_email">
    
                <EditText
                    android:id="@+id/.."
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:inputType="textEmailAddress"
                    android:padding="8dp" />
            </android.support.design.widget.TextInputLayout>
    
            <android.support.design.widget.TextInputLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:hint="@string/login_password">
    
                <EditText
                    android:id="@+id/editTextPasswordForLogin"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:inputType="textPassword"
                    android:padding="8dp" />
            </android.support.design.widget.TextInputLayout>
        </LinearLayout>
    </android.support.v7.widget.CardView>
    
    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginTop="@dimen/activity_vertical_margin"
        android:orientation="horizontal">
    
        <TextView
            android:id="@+id/textViewForgotPassword"
            style="@style/WarrentyLifeTheme.TextAppearance.Small"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="center"
            android:text="@string/login_forgot_password" />
    
        <Space
            android:layout_width="0dp"
            android:layout_height="match_parent"
            android:layout_weight="1" />
    
        <Button
            android:id="@+id/buttonLogin"
            android:layout_width="wrap_content"
            android:layout_height="@dimen/buttonHeight"
            android:paddingLeft="36dp"
            android:paddingRight="36dp"
            android:text="@string/dashboard_button_login" />
    
    </LinearLayout>
    
        3
  •  0
  •   Szymon Chaber    7 年前

    android:background="@null"
    

    推荐文章