Android CardView简单介绍

匿名 (未验证) 提交于 2019-12-03 00:30:01

一、介绍:CardView可以实现卡片布局,拥有圆角和阴影效果

1.导入包

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

一般配合RecyclerView ,和Glide(图片加载库)使用

implementation 'com.android.support:recyclerview-v7:27.1.1'

/*图片加载库*/

compile 'com.github.bumptech.glide:glide:3.7.0'

2.基本用法,其实也是一个FrameLayout布局

<android.support.v7.widget.CardView      xmlns:android="http://schemas.android.com/apk/res/android"     android:layout_width="match_parent"     android:layout_height="match_parent"     xmlns:app="http://schemas.android.com/apk/res-auto"     app:cardCornerRadius="4dp"     android:elevation="5dp">      <TextView         android:id="@+id/info_text"         android:layout_width="match_parent"         android:layout_height="wrap_content" />  </android.support.v7.widget.CardView>

3.方法

CardView难度不大,不举例子了



标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!