Material Design 5.0 新特性

一.receleView

receleView 就是listView的孙子

代替了listview 和 gridView 实现两者转化只需设置LayoutManager

也需要有自己的适配器,RecyclerView.Adapter

    -- onCreateViewHolder() :创建viewholder

    -- onBindViewHolder : 绑定 viewholder 上的view 以及传的数据

二.DrawerLayout 

http://blog.csdn.net/allen315410/article/details/42914501

这是解决侧滑菜单的控件,一般和navitgtionView 联合使用

101707_bZKH_2704624.png

<?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>

 

 

 

 

 

转载于:https://my.oschina.net/yanglingui/blog/834552

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值