CardView继承自FrameLayout类,可以在一个卡片布局中一致性的显示内容,卡片可以包含圆角和阴影。CardView是一个Layout,可以布局其他View.

官网地址: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

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新特性学习--CardView的更多相关文章

  1. android 5.0新特性学习--视图阴影

    android 5.0的视图阴影主要是体验出层次性,就是在一个物体上面叠加上一层的设计,而这种设计就是除了传统的,x,y的纸面层,还有就是透过纸面的z轴的层次设计. elevation: 高度,静态属 ...

  2. android 5.0新特性学习总结之下拉刷新(一)

    android 5.0 后google最终在 support v4 包下 添加了下拉刷新的控件 项目地址: https://github.com/stormzhang/SwipeRefreshLayo ...

  3. android 5.0新特性学习--RecyclerView

    在过去很多年,我们的PC或者手机设备都是采用拟物化的设计风格,IOS采用扁平化的特性,android在2014年IO大会上说采用Material Design的设计风格,显示效果不能过于生硬的转换,而 ...

  4. android 5.0新特性学习--Drawable Tinting(为图片资源着色)

    使用android:tint属性去调整色调.android:tintMode 着色模式 screen multiply and src_atop/src_in/src_oversetTint(int ...

  5. android 5.0新特性学习--视图轮廓

    ViewOutlineProvider -- 视图轮廓setOutlineProvider--可以使用View.setClipToOutline方法去剪切一个视图的outline区域.只有rectan ...

  6. Android 6.0 新特性 整理 资料来自网络

    Android 6.0新特性 Runtime Permissions Doze and App Standby Apache HTTP Client Removal BoringSSL Access ...

  7. Android 8.0 新特性

    Android 8.0 (Android Oreo(奥利奥))新特性介绍 通知渠道 - Notification Channels 通知渠道是由应用自行定义的通知内容类别,借助渠道,开发者可以让用户对 ...

  8. android 7.0 新特性 和对开发者的影响

    android 7.0新特性 - jiabailong的专栏 - 博客频道 - CSDN.NEThttp://blog.csdn.net/jiabailong/article/details/5241 ...

  9. 腾讯云安全:开发者必看|Android 8.0 新特性及开发指南

    欢迎大家关注腾讯云技术社区-博客园官方主页,我们将持续在博客园为大家推荐技术精品文章哦~ 背景介绍 谷歌2017 I/O开发者大会今年将于5月17-19日在美国加州举办.大会将跟往年一样发布最新的 A ...

随机推荐

  1. C#第九天

    1.绝对路径和相对路径绝对路径:通过给定的这个路径直接能在我的电脑中找到这个文件. 相对路径:文件相对于应用程序的路径. 结论:我们在开发中应该去尽量的使用相对路径. 2.装箱.拆箱 装箱:就是将值类 ...

  2. js怎么判断浏览器类型

    <script type=“text/javascript”> function isIE(){return navigator.appName.indexOf(“Microsoft In ...

  3. Brackets + Sass 学习心得

    大家知道Brackets是一个可以实时浏览html页面修改效果的工具,对于前段开发人员应该不会陌生,有了它,布局页面再也不是什么困难了, 目前为止已经更新到1.6了. 下载最新版可以到官方网: htt ...

  4. ssh连接ubuntu提示连接不上的问题

    今天在自己的电脑上安装了最新版本的 ubuntu (我都在root用户下运行,非root用户请添加sudo命令) uname -rvo 运行结果为 3.13.0-32-generic #57-Ubun ...

  5. sql or 与and同时有时要注意

    如果是一天sql语句中有or和and同时在 正确:where xxx=xx and (xxx=xx or xxx=xx) 错误:where xxx=xx and xxx=xx or xxx=xx (这 ...

  6. bootstrap ch2清除浮动

    <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <meta name ...

  7. thinkphp整合系列之phpqrcode生成二维码

    php生成二维码其实挺简单的:当然指的是使用qrcode类库: 因此关于是否要写这篇博客:我是犹豫了再三的: 不过最后还是决定写下吧:如果有童鞋急着用:就可以直接引了: 再个也可以作为即将写的文章微信 ...

  8. python 输出重定向

    使print既打印到终端,又写入文件 class Tee(object): def __init__(self,*files): self.files = files def write(self,o ...

  9. linux中的 tar命令的 -C 参数,以及其它一些参数(转)

    linux中的 tar命令的 -C 参数,以及其它一些参数 复制源:http://www.cnblogs.com/li-hao/archive/2011/10/03/2198480.htmltar命令 ...

  10. html标签全称和功能介绍

    html标签全称和功能介绍,里面有些大家不常用的,主要是方便大家查找检索   按字母顺序排列 DTD:指示在哪种 XHTML 1.0 DTD 中允许该标签.S=Strict, T=Transition ...