Android CardView在棒棒糖前的设备中显示黑色(不太好看)阴影
当长时间按下或单击通常会在含有棒棒糖或更大棒棒糖的设备中显示波纹的位置时,pre lollipop设备上的Cardview会显示一个难看的黑色渐变 这是我的CardView XMLAndroid CardView在棒棒糖前的设备中显示黑色(不太好看)阴影,android,xml,android-layout,android-studio,android-cardview,Android,Xml,Android Layout,Android Studio,Android Cardview,当长时间按下或单击通常会在含有棒棒糖或更大棒棒糖的设备中显示波纹的位置时,pre lollipop设备上的Cardview会显示一个难看的黑色渐变 这是我的CardView XML <android.support.v7.widget.CardView android:id="@+id/cardview1" android:layout_width="match_parent" android:layout_height="match_parent" st
<android.support.v7.widget.CardView
android:id="@+id/cardview1"
android:layout_width="match_parent"
android:layout_height="match_parent"
style="@style/swipe_section_padding"
android:foreground="?android:attr/selectableItemBackground"
android:clickable="true"
card_view:cardCornerRadius="3dp"
card_view:cardElevation="0dp"
card_view:contentPadding="0dp">
<RelativeLayout ...
</android.support.v7.widget.CardView>
尝试添加卡\u视图:cardusecompatipadding=“false”属性
UseCompatding boolean:true>如果CardView应该为
在棒棒糖和上面的平台上的阴影
检查
检查此项在预览中效果良好,将其添加为android:background=“?android:attr/selectableItemBackground”
而不是前台
。我还没有时间。我会试试这个,让你知道。
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:card_view="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="10dip" >
<android.support.v7.widget.CardView
android:id="@+id/cardview1"
android:layout_width="match_parent"
android:layout_height="100dp"
android:clickable="true"
android:foreground="?android:attr/selectableItemBackground"
card_view:cardCornerRadius="3dp"
card_view:cardElevation="2dp"
card_view:cardUseCompatPadding="false"
card_view:contentPadding="0dp" >
</android.support.v7.widget.CardView >
</LinearLayout >