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

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

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

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

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

布局

<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

更多相关文章

  1. android 使用Sax 读取xml
  2. 【Android(安卓)Developers Training】 7. 添加Action Buttons
  3. Android(安卓)8.0 高通代码预制apk可卸载,恢复出厂设置apk可恢复
  4. android 局部界面动态切换
  5. Android(安卓)studio 添加依赖库的方法
  6. Android(安卓)判断当前的界面是否是桌面的方法
  7. 【Android(安卓)studio】为按钮添加简单事件
  8. Android百度地图之页面跳转
  9. Android菜鸟笔记-Fragment日常使用记录

随机推荐

  1. 关于ListView中假如Button,EditText无法响
  2. Android 驱动开发文章收录
  3. android 默认浏览器 无法下载,此手机不支
  4. 【30篇突击 android】源码统计 十三
  5. android ATD configeration
  6. android之屏幕适配之一理论知识
  7. android传感器总结
  8. 【Demo实例】Android FTP上传带进度条(优
  9. Android通过http协议POST传输方式(输出流
  10. 使用InjectView和findViewById说拜拜