<android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/drawerlayout"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<LinearLayout
android:id="@+id/fragment_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<Button
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="1" />
</LinearLayout>
<RelativeLayout
android:id="@+id/left"
android:layout_width="200dp"
android:layout_height="match_parent"
android:layout_gravity="left" ...或者start,在mainView左边显示
android:background="@android:color/white" >
<ListView
android:id="@+id/left_listview"
android:layout_width="match_parent"
android:layout_height="match_parent" >
</ListView>
</RelativeLayout>
<ScrollView
android:layout_width="260dp"
android:layout_height="match_parent"
android:layout_gravity="end" ...在在mainView右边显示
android:background="@android:color/holo_green_light"
android:clickable="true" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical" >
<Button
android:id="@+id/right_textview"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="个人登陆页面1" />
</LinearLayout>
</ScrollView>
</android.support.v4.widget.DrawerLayout>
Activity中调用
mDrawerLayout.closeDrawers(); //关闭抽屉