首页 > 移动平台 > 详细

android的DrawerLayout用法

时间:2015-08-25 18:22:29      阅读:576      评论:0      收藏:0      [点我收藏+]

DrawerLayout的关键点(我认为的)就在于layout文件的layout_gravity属性的值,只有左右,两种选择,不能从上下滑出来,就算有这个效果也不是这个套路弄出来的。

<?xml version="1.0" encoding="utf-8"?>
<android.support.v4.widget.DrawerLayout
    android:id="@+id/slidepanellayout"
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <TextView
        android:id="@+id/a"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:text="a"/>

    <TextView
        android:id="@+id/b"
        android:layout_gravity="end"
        android:background="#0000ff"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:text="b"/>
</android.support.v4.widget.DrawerLayout>

至于颜色默认是透明,必须加个色,不然是重复的。

android的DrawerLayout用法

原文:http://www.cnblogs.com/gelandesprung/p/4757868.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!