标签:
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>
至于颜色默认是透明,必须加个色,不然是重复的。
标签:
原文地址:http://www.cnblogs.com/gelandesprung/p/4757868.html