1.这两句是侧滑的关键 谁用谁就可以侧滑
android:layout_gravity="left"
android:choiceMode="singleChoice"
1.侧滑的xml布局
<android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:id="@+id/dea" android:layout_width="match_parent" android:layout_height="match_parent" tools:context="bawei.com.day7_drawer.MainActivity"> <FrameLayout android:id="@+id/fragment" android:layout_width="match_parent" android:layout_height="match_parent"></FrameLayout> <ListView android:id="@+id/lv" android:layout_width="240dp" android:layout_height="match_parent" android:layout_gravity="start" android:background="#ff00ff" android:choiceMode="singleChoice" android:divider="@android:color/transparent" android:dividerHeight="0dp" /> </android.support.v4.widget.DrawerLayout>