SlidingDrawer和SlidingMenu差不多,只是功能比SlidingMenu弱一点,稍作介绍:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<View
android:layout_width="match_parent"
android:layout_height="300dp" />
<SlidingDrawer
android:id="@+id/my_drawer"
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/icon" />
</LinearLayout>
<LinearLayout
android:id="@id/my_content"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#88000000"
android:gravity="center"
android:orientation="horizontal" >
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="content" />
</LinearLayout>
</SlidingDrawer>
</LinearLayout>
必须指定handle和content下面的控件的id,就是此处指定的id.(为其孩子)