如果想让handle显示在右上要按代码中的配置,主要width = wrap_content,还有id要放在LinearLayout上
SlidingDrawer的orientation属性可以让抽屉出现在下或者右,但是不能是上或做,自定义控件可以实现
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<SlidingDrawer
android:layout_width="match_parent"
android:layout_height="match_parent"
android:content="@+id/my_content"
android:handle="@+id/my_handle"
android:orientation="horizontal" >
<LinearLayout
android:id="@id/my_handle"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:orientation="vertical" >
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/ic_launcher" />
</LinearLayout>
<GridView
android:id="@id/my_content"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:numColumns="3" />
</SlidingDrawer>
</LinearLayout>