android v13 的新特性

新版本(V13)的support库引入了DrawerLayout和SlidingPaneLayout控件,支持NavigationDrawer模式及摘要详情界面模式。此外,还提供了ActionBarDrawerToggle工具类用于整合DrawerLayout与ActionBar。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

转载自 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

转载于:https://www.cnblogs.com/asijack/p/4241588.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值