android 5.0新特性学习--CardView
2014-12-29 22:25
267 查看
CardView继承自FrameLayout类,可以在一个卡片布局中一致性的显示内容,卡片可以包含圆角和阴影。CardView是一个Layout,可以布局其他View.
官网地址:https://developer.android.com/reference/android/support/v7/widget/CardView.html
继承关系:
CardView的属性:
elevation --CardView的Z轴阴影(也就是阴影的高度)“android:elevation = "100dp";
cardBackgroundColor--CardView的卡片颜色(cardView背景颜色);
cardConerRadius -- CardView卡片的四角圆角矩形程度(cardview圆角半径);
下面xml文件中即表示这个card控件为:矩形程度为8dp,背景颜色为黑色的卡片。
官网地址:https://developer.android.com/reference/android/support/v7/widget/CardView.html
继承关系:
java.lang.Object | ||||
↳ | android.view.View | |||
↳ | android.view.ViewGroup | |||
↳ | android.widget.FrameLayout | |||
↳ | android.support.v7.widget.CardView |
elevation --CardView的Z轴阴影(也就是阴影的高度)“android:elevation = "100dp";
cardBackgroundColor--CardView的卡片颜色(cardView背景颜色);
cardConerRadius -- CardView卡片的四角圆角矩形程度(cardview圆角半径);
下面xml文件中即表示这个card控件为:矩形程度为8dp,背景颜色为黑色的卡片。
<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" app:cardCornerRadius="8dp" app:cardBackgroundColor="@color/black" android:layout_margin="8dp" android:layout_height="80dp" android:layout_width="match_parent"> <TextView android:text="TextView in CardView" android:layout_gravity="center" android:textSize="26sp" android:textColor="@color/l_white" android:layout_width="wrap_content" android:layout_height="wrap_content" /> </android.support.v7.widget.CardView>
相关文章推荐
- android 5.0新特性学习--Drawable Tinting(为图片资源着色)
- android 5.0新特性学习总结之下拉刷新(一)
- android 5.0新特性学习总结之下拉刷新(一)
- Android 5.0 部分新特性学习
- android 5.0新特性学习--视图阴影
- android新特性:5.0新特性学习总结之下拉刷新
- android 5.0新特性学习总结之阴影特效(二)
- android 5.0新特性学习--RecyclerView
- android 5.0新特性学习--视图轮廓
- Android 5.0 十大新特性
- ym—— Android 5.0学习之AnimatedVectorDrawable
- ym—— Android 5.0学习之使用Material主题
- ym—— Android 5.0学习之CardView
- ym—— Android 5.0学习之ListView升级版RecyclerView
- Android 5.0 Lollipop 安全特性详解
- ym—— Android 5.0学习之Tinting和Clipping
- android 5.0新特性
- Android 5.0以下使用Material Design 特性
- ym—— Android 5.0学习之定义阴影
- android 5.0新特性