【Android】CardView

  • 官方地址
  • 引入v7库
  • 创建卡片

 

官方地址

https://developer.android.com/reference/android/support/v7/widget/CardView

https://developer.android.com/guide/topics/ui/layout/cardview

 

引入v7库

原文:

The CardView widget is part of the v7 Support Libraries.

如果要使用,这个组件,就要引入v7支持库。

implementation 'com.android.support:cardview-v7:28.0.0'

 

创建卡片

直接在布局文件中使用这个组件即可,示例:

<android.support.v7.widget.CardView
        xmlns:card_view="http://schemas.android.com/apk/res-auto"
        android:id="@+id/card_view"
        android:layout_gravity="center"
        android:layout_width="200dp"
        android:layout_height="200dp"
        card_view:cardCornerRadius="4dp">
</android.support.v7.widget.CardView>

posted on 2019-04-22 17:49  Deonew  阅读(139)  评论(0编辑  收藏  举报

导航