Android 5.x新增控件之-CardView
来源:互联网 发布:淘宝如何做全屏店招 编辑:程序博客网 时间:2024/05/18 01:27
1.作用
CardView 属于Support v7 里面的新的Widget. 扩展于FrameLayout,
UI显示主要包括
1.边框圆角
2.有阴影Shadow
用来突出个性,比如展览,相册等。
UI显示主要包括
1.边框圆角
2.有阴影Shadow
用来突出个性,比如展览,相册等。
2.使用
2.1 引入compile 'com.android.support:cardview-v7:21.0.+'
2.2 布局文件中加入xmlns:card_view="http://schemas.android.com/apk/res-auto"
2.3定义CardView标签
<?xml version="1.0" encoding="utf-8"?><LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:card_view="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" android:layout_height="65dp"> <android.support.v7.widget.CardView xmlns:card_view="http://schemas.android.com/apk/res-auto" android:id="@+id/card_view" android:layout_width="match_parent" android:layout_height="50dp" card_view:cardBackgroundColor="@android:color/white" android:layout_marginLeft="10dp" android:layout_marginRight="10dp" android:layout_marginTop="5dp" android:layout_marginBottom="5dp" card_view:cardCornerRadius="10dp" card_view:cardElevation="24dp"> <TextView android:id="@+id/title_tv" android:layout_width="match_parent" android:layout_height="wrap_content" android:padding="15dp" android:textColor="#000000" android:textSize="16sp" /> </android.support.v7.widget.CardView></LinearLayout>
3.重要属性
card_view:cardCornerRadius="10dp" 圆角的半径
card_view:cardElevation="24dp" 阴影shadow
card_view:cardElevation="24dp" 阴影shadow
4.其他博文
http://blog.csdn.net/birdsaction/article/details/45197499
官方文档
https://developer.android.google.cn/reference/android/support/v7/widget/CardView.html
阅读全文
1 0
- Android 5.x新增控件之-CardView
- Android 5.x之CardView
- Android 5.x新增控件之-Snackbar控件
- Android 5.x新增控件之-Toolbar控件
- Android 5.x新增控件之-FloatingActionButton控件
- Android 5.x新增控件之-TextInputLayout控件
- Android控件之CardView
- Android 5.x新增控件之-RecylcerView实现ListView/GridView
- Android 5.x新增控件之-RecylcerView实现瀑布流
- Android 5.x(一) 新控件之RecyclerView,CardView,Palette的使用
- Android MD控件之CardView
- Android MD控件之CardView
- Android L 新增UI控件:RecyclerView CardView的简单使用
- 5.x控件:CardView、RecyclerView、SwipeRefreshLayout
- Android 5.x新增控件之--TabLayout实现左右滑动导航菜单
- Android5.x 新控件之RecyclerView,CardView,Palette的使用
- Android5.x 新控件之RecyclerView,CardView,Palette的使用
- Android5.x 新控件之RecyclerView,CardView,Palette的使用
- 关于集中注意力
- Android Clip用法——自定义进度条
- 1060. Are They Equal (25)
- 论文笔记:Learning Deep Features for Discriminative Localization
- 典型相关分析及相关知识
- Android 5.x新增控件之-CardView
- POJ 3624
- POJ 1182 食物链 (分类并查集)
- 学习的本质
- HDU-1181-变形课
- ConcurrentHashMap实现原理
- OneDrive卸载后无法更新
- wpf mvvm学习笔记
- HDU 1232 畅通工程