【发布时间】:2017-02-19 22:10:17
【问题描述】:
我实现了一个LisView,它具有嵌套的卡片视图和一个自定义的ImageView 用于阴影。这是布局:
<android.support.v7.widget.CardView
android:id="@+id/food_card_view"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="2dp"
card_view:cardBackgroundColor="@android:color/transparent"
card_view:cardCornerRadius="0dp"
card_view:cardElevation="0dp"
card_view:cardPreventCornerOverlap="false">
(... views here ...)
</android.support.v7.widget.CardView>
问题在于 CardView 显示在某些设备上具有高度值,即使 card_view:cardElevation="0dp" 设置为 0dp。
【问题讨论】:
-
如果你不想要阴影效果,为什么要使用 CardView?这就是卡片的全部观点
-
你说得对,我错过了一些步骤啊哈。我的意思是,我首先实现了 RecyclerView,然后由于回收项目的一些问题而更改为 ListView,我没有意识到我可以简单地删除 CardView 并将其替换为正常布局。谢谢;)
标签: android cardview android-elevation