Here is a SlidingDrawer
sample app. In particular, here is the layout:
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#FF4444CC"
>
<SlidingDrawer
android:id="@+id/drawer"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:handle="@+id/handle"
android:content="@+id/content">
<ImageView
android:id="@id/handle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/tray_handle_normal"
/>
<Button
android:id="@id/content"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:text="I'm in here!"
/>
</SlidingDrawer>
</FrameLayout>
Now, in this case, the whole activity is just a SlidingDrawer
. That's relatively unusual -- this sample is short because it is from a book.
More commonly, I would expect you to put a SlidingDrawer
as a child of a RelativeLayout
, so you can have other children of the RelativeLayout
and have the drawer slide over top of them when opened. I believe you will need the SlidingDrawer
to be the last child of the RelativeLayout
in this case.