如何使CardView在图像上引人注目?

问题描述 投票:0回答:3

我正在上传两个屏幕截图以进行比较。

CardView值得注意的enter image description here

CardView unnoticealbe(向下滚动时)enter image description here

android android-cardview
3个回答
0
投票

您需要添加RecyclerView视图的上边距,因此,当滚动RecyclerView项目时,您的热门卡片视图将在您的第一个屏幕中显示。有点像

android:layout_marginTop="20dp"

0
投票

您的问题对我来说还不清楚。无论如何,在查看了这两个图像之后,您可以..

尝试将margin_top赋予网格回收器视图。

android:layout_marginTop="25dp"

并且您需要将cardElevation属性赋予您的cardView。

app:cardElevation="8dp"

0
投票

您可以将card_view:cardCornerRadius =“”用于圆角,将card_view:cardElevation =“”用于XML布局中的阴影效果。

下面的代码可以检查

<android.support.v7.widget.CardView
        android:id="@+id/card_view"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_gravity="center"
        android:layout_margin="8dp"
        android:elevation="3dp"
        card_view:cardCornerRadius="10dp"
        android:padding="8dp">
</android.support.v7.widget.CardView>

希望这会对您有所帮助。

© www.soinside.com 2019 - 2024. All rights reserved.