CardView
Overview
CardView card layout
Example
<CardView>
<LinearLayout android:orientation="vertical">
<TextView android:layout_width="match_parent" android:layout_height="wrap_content"
android:padding="20dp" android:text="CardView Demo"/>
<ImageView
android:src="https://upload.jianshu.io/users/upload_avatars/4321745/406ef6d9-28c1-4f35-8cee-37818cc404af.jpg"
android:layout_width="200dp" android:layout_height="200dp" android:scaleType="CENTER_CROP"/>
</LinearLayout>
</CardView>
Properties
Common Properties
Private Properties
| Property | Description | Values |
|---|---|---|
| layout_weight | Child weight | Number When the parent is LinearLayout, child controls can set weight |
| cardBackgroundColor | Background color | Number e.g. #888888 |
| cardCornerRadius | Corner radius | Number e.g. 20dp |
| cardElevation | Z-axis shadow | Number e.g. 20dp |
| cardMaxElevation | Maximum Z-axis elevation | Number e.g. 20dp |