【发布时间】:2016-08-06 02:47:53
【问题描述】:
我试图从 Cardview 中移除阴影。
我在android v4.4.2上使用了android support v7 Cardview
我的布局外观:
<android.support.v7.widget.CardView
android:id="@+id/cardContainer"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@null"
card_view:cardBackgroundColor="@color/transparent"
card_view:cardCornerRadius="0dp"
card_view:cardElevation="0dp"
card_view:cardPreventCornerOverlap="false"
card_view:contentPadding="0dp">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<include layout="@layout/include_profile_header" />
<include layout="@layout/include_profile_footer" />
</RelativeLayout>
</android.support.v7.widget.CardView>
如你所见,我使用过:
card_view:cardElevation="0dp"
到目前为止尝试过:
android:background="@null"
但您仍然可以在图像中看到我附加的顶部阴影。
【问题讨论】:
-
尝试删除 cardBackgroundColor @motis10
-
android:cardBackgroundColor 不存在并且 card_view:cardBackgroundColor 也不存在
-
card_view:cardBackgroundColor="@color/transparent" 删除这个
-
但比它添加到我的布局白色背景。正如你在图片中看到的,我希望它是透明的。
标签: android android-layout layout android-support-library