Android CardView之间的空间随着cardElevation的增加而增加
回收视图中的CardView之间的间距随着我增加卡片高度而增加Android CardView之间的空间随着cardElevation的增加而增加,android,android-layout,android-cardview,Android,Android Layout,Android Cardview,回收视图中的CardView之间的间距随着我增加卡片高度而增加 <android.support.v7.widget.CardView android:layout_width="wrap_content" android:layout_height="wrap_content" android:background="@android:color/white" android:foreground="?andro
<android.support.v7.widget.CardView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@android:color/white"
android:foreground="?android:attr/selectableItemBackground"
app:cardBackgroundColor="@android:color/white"
app:cardCornerRadius="12dp"
app:cardElevation="20dp"
app:cardUseCompatPadding="true">
然后,由于我已将app:cardUseCompatPadding设置为true,因此项目之间的间距将两个卡视图上的卡高度相加。我尝试在另一个LinearLayout中包装卡视图,并将其作为recyclerview项目,但仍然得到相同的结果。
任何人都有比设置负填充/边距更好的解决方案吗?它肯定会增加您可以禁用app:carducecompatipadding=“true”并设置为false,这样可以提供边距。它肯定会增加您可以禁用app:carducecompatipadding=“true”并设置为false,这样可以提供边距。