android v13 的新特性

转载自 http://blog.chengyunfeng.com/?p=493 mark下

新版本(V13)的support库,几个比较重要的功能

 

1、添加 DrawerLayout 控件,支持创建  Navigation Drawer模式。可以设置从左边划出菜单或者右边,也可以左右菜单同时存在。

 

2、添加 SlidingPaneLayout 控件来支持各种屏幕上的摘要、详情界面模式。比如 Gmail邮件列表和单个邮件详情界面。当在手机上显示的时候,邮件列表和详情界面分别为两个界面;当在平板上显示的时候,则为一个界面。

3、添加 ActionBarDrawerToggle 工具类,方便把 DrawerLayout 和 ActionBar 功能结合起来。

布局

<android.support.v4.widget.DrawerLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/drawer_layout"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <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="240dp"
        android:layout_height="match_parent"
        android:layout_gravity="start"
        android:choiceMode="singleChoice"
        android:divider="@android:color/transparent"
        android:dividerHeight="0dp"
        android:background="#FF0011"/>
</android.support.v4.widget.DrawerLayout>

 

转载至:http://blog.chengyunfeng.com/?p=493

 

代码下载地址:

https://github.com/asijack/NavigationDrawerExample

posted @ 2015-01-22 14:27  asijack  阅读(266)  评论(0编辑  收藏  举报