Material Design 5.0 新特性
2017-02-09 00:00
155 查看
摘要: 在开发的时候,我们应该尽量使用android 原有的特性 , 这样既可以 方便快捷 也可以统一android app的样式
代替了listview 和 gridView 实现两者转化只需设置LayoutManager
也需要有自己的适配器,RecyclerView.Adapter
-- onCreateViewHolder() :创建viewholder
-- onBindViewHolder : 绑定 viewholder 上的view 以及传的数据
这是解决侧滑菜单的控件,一般和navitgtionView 联合使用
一.receleView
receleView 就是listView的孙子代替了listview 和 gridView 实现两者转化只需设置LayoutManager
也需要有自己的适配器,RecyclerView.Adapter
-- onCreateViewHolder() :创建viewholder
-- onBindViewHolder : 绑定 viewholder 上的view 以及传的数据
二.DrawerLayout
http://blog.csdn.net/allen315410/article/details/42914501这是解决侧滑菜单的控件,一般和navitgtionView 联合使用
<?xml version="1.0" encoding="utf-8"?> <android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:id="@+id/drawer_layout" android:layout_width="match_parent" android:layout_height="match_parent" tools:context="ylg.com.cn.dralayoutdemo.MainActivity"> <FrameLayout android:id="@+id/content_frame" android:layout_width="match_parent" android:layout_height="match_parent" /> <ListView android:id="@+id/left_drawer" android:layout_width="200dp" android:layout_height="match_parent" android:layout_gravity="start" android:background="#111" android:choiceMode="singleChoice" android:divider="@android:color/transparent" android:dividerHeight="0dp" /> <RelativeLayout android:id="@+id/right_drawer" android:layout_width="220dp" android:layout_height="match_parent" android:layout_gravity="end" android:background="#111" android:gravity="center_horizontal" > <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="这是右边栏" android:textColor="@android:color/white" android:textSize="24sp" /> </RelativeLayout> </android.support.v4.widget.DrawerLayout>
相关文章推荐
- Android L(SDK 5.0)新特性(Material Design)
- android 5.0新特性之Material Design 使用Material主题
- Android 5.0以下使用Material Design 特性
- Android 新特性继Android L(5.0)之后,Android M到来了
- 第18天 jdk5.0新特性及图书管理系统
- J2SE 5.0新特性(四)自动装箱/拆箱
- J2SE 5.0新特性(一)枚举
- Android(Lollipop/5.0) Material Design简介
- Android 5.0,6.0新特性
- Android(Lollipop/5.0) Material Design(三) 使用Material主题
- jdk5.0新特性
- J2se5.0 generis新特性
- C# 5.0将带来的五大新特性
- android 5.0新特性学习--Drawable Tinting(为图片资源着色)
- J2SE5.0新特性之自动装箱解箱
- J2SE5.0新特性之范型编程
- MySQL 5.0新特性教程(一)
- Android 5.0新特性,共享元素及RevealAnimator实现华丽的详情页面
- paip.php 5.0 5.3 5.4 5.5 -6.0的新特性总结与比较
- Android(Lollipop/5.0) Material Design(四) 创建列表和卡片