android 5.0新特性学习--CardView

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

CardView的属性:

  elevation --CardView的Z轴阴影;

  cardBackgroundColor--CardView的卡片颜色;

  cardConerRadius -- 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>  
时间: 2024-08-04 15:29:03

android 5.0新特性学习--CardView的相关文章

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

android 5.0 后google终于在 support v4 包下 增加了下拉刷新的控件 项目地址: https://github.com/stormzhang/SwipeRefreshLayoutDemo xml: <android.support.v4.widget.SwipeRefreshLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/swi

android 5.0新特性学习--RecyclerView

在过去很多年,我们的PC或者手机设备都是采用拟物化的设计风格,IOS采用扁平化的特性,android在2014年IO大会上说采用Material Design的设计风格,显示效果不能过于生硬的转换,而是平滑,过度的切换方式,避免线性的动画效果,而是代替以曲线的效果进行展示,并且所有的图标的动画切换都应该无缝化切换. 如果想深入了解材料设计即(material Design)的设计: 可以参看如下网址:http://design.1sters.com,尤其是android 应用的UED设计师们,可

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

使用android:tint属性去调整色调.android:tintMode 着色模式 screen multiply and src_atop/src_in/src_oversetTint(int tint)setTint(int tint)的参数,可以是一个@color/下的属性,也可以是一个xml的selector,selector中的item是使用了数字的 <selector xmlns:android="http://schemas.android.com/apk/res/and

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

ViewOutlineProvider -- 视图轮廓setOutlineProvider--可以使用View.setClipToOutline方法去剪切一个视图的outline区域.只有rectangle,circle, 和round rectangle outlines支持裁剪(Outline.canClip方法用来判断是否可以裁剪) ViewOutlineProvider viewOutlineProvider = new ViewOutlineProvider() { // @Overr

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

android 7.0新特性 - jiabailong的专栏 - 博客频道 - CSDN.NEThttp://blog.csdn.net/jiabailong/article/details/52411300 android 7.0对开发者会有哪些影响 - jiabailong的专栏 - 博客频道 - CSDN.NEThttp://blog.csdn.net/jiabailong/article/details/52411353 android 7.0 多窗口及新特性demo - jiabail

Android 8.0新特性介绍以及注意事项

2017年8月22日,谷歌正式发布了Android 8.0的正式版,其正式名称为:Android Oreo(奥利奥) .在此之前 临时代号叫: Android O.对应Api level 为26. 2017年12月5日 , 谷歌正式发布了Android 8.1的正式版.对应的Api Level 为27 . Powerful 强大       Secure 安全              Fast 流畅            Smart&seamiess  轻巧&无缝 Android 8.0

开发者必看|Android 8.0 新特性及开发指南

背景介绍 谷歌2017 I/O开发者大会今年将于5月17-19日在美国加州举办.大会将跟往年一样发布最新的 Android 系统,今年为 Android 8.0.谷歌在今年3 月21日发布 Android 新系统开发者预览版时已给新系统取名为 Android O.自2008 年发布以来, Android 依靠 Google 的生态运作,全球市场份额在2016年底已超过85% .而近几年依靠 Android 发展起来的智能手机厂商不断增加, Android 生态大家庭也正在不断壮大. Androi

android 5.0新特性

Android Lollipop 面向开发者的主要功能 Material Design 设计 注重性能 通知 以大屏幕呈现 以文档为中心 连接性能再上一级 高性能图形 音频处理功能更强 摄像头和视频处理进一步完善 Android 在办公中的应用 屏幕截图和共享 新型传感器 Chromium WebView 辅助功能和输入 构建低电耗应用 欢迎使用 Android 5.0 Lollipop,这是迄今为止规模最大最为雄心勃勃的 Android 版本! 此版本为用户推出了各种崭新的新功能,为开发者则提

android 5.0新特性CardView教程

CardView 是android5.0新加入的特性,大家先别着急,由于谷歌出了cardview的兼容包,也就是android.support.v7.widget.CardView包,所以在5.0以下的系统也可以运行这个效果.什么是CardView ?就是在View的外面加上一个类似如卡片的阴影,下面放代码. <RelativeLayout android:layout_width="match_parent" android:layout_height="wrap_c