Android开发 之 CardView及常用属性
来源:互联网 发布:linux acl chown 区别 编辑:程序博客网 时间:2024/05/17 01:00
CardView及常用属性
引入 compile 'com.android.support:cardview-v7:21.0.+'
app:cardElevation 属性向下兼容 为了统一不同系统版本的视觉效果,Google 针对 SDK 21 以下的系统给 CardView 加入一个 Elevation 兼容(即 XML 中的 app:cardElevation 和 Java 代码中的 setCardElevation)。
cardElevation 阴影的大小cardMaxElevation 阴影最大高度cardCornerRadius 卡片的圆角大小contentPadding 卡片内容于边距的间隔 contentPaddingBottom contentPaddingTop contentPaddingLeft contentPaddingRight contentPaddingStart contentPaddingEndcardUseCompatPadding 设置内边距,V21+的版本和之前的版本仍旧具有一样的计算方式**:cardPreventConrerOverlap 在V20和之前的版本中添加内边距,这个属性为了防止内容和边角的重叠**
<?xml version="1.0" encoding="utf-8"?><android.support.v7.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:id="@+id/cardview" android:layout_width="match_parent" android:layout_height="200dp" android:layout_margin="10dp" app:cardElevation="10dp" app:cardCornerRadius="10dp" > <LinearLayout android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical"> <ImageView android:id="@+id/iv_icon" android:layout_width="match_parent" android:layout_height="match_parent" android:layout_margin="5dp" /> <TextView android:id="@+id/tv_name" android:layout_width="wrap_content" android:layout_height="wrap_content" /> </LinearLayout> </android.support.v7.widget.CardView>
阅读全文
0 0
- Android开发 之 CardView及常用属性
- Android CardView的常用属性
- CardView的常用属性
- CardView使用及属性
- Android开发之CardView的使用
- Android开发之CardView卡片布局
- Android开发--CardView使用
- Android开发--CardView使用
- Android开发--CardView使用
- Android开发--CardView使用
- Android开发--CardView使用
- Android开发--CardView使用
- android开发之布局常用属性
- Android应用开发:CardView的使用及兼容
- Android应用开发:CardView的使用及兼容
- Android应用开发:CardView的使用及兼容
- Android应用开发:CardView的使用及兼容
- Android应用开发:CardView的使用及兼容
- ngrok--内网穿透神器
- mysql 基础操作命令记录
- 日常笔记:js中数组的相关操作
- 算法系列-大数据面试题-大文件中返回频数最高的100个词
- Halcon部分语法【3】
- Android开发 之 CardView及常用属性
- 身份证阅读器(读卡器)谷歌Chrome和火狐Firefox浏览器端网页开发接口控件分享
- mysql学习笔记
- fl2440之initramfs文件系统制作与移植
- Spring AOP进行日志记录,管理
- Jupyter无法导入已安装的 module
- 2017最新手机版cps诱导支付源码
- ids for this class must be manually assigned
- 浏览者不需要在这个上面浪费时间,net一些问题解决方法--这是自己写的