當(dāng)drawerlayout劃出來之后二汛,再往回滑時(shí)發(fā)現(xiàn)滑不回去了,是因?yàn)闆]有將NavigationView放到最后面拨拓,將NavigationView放到最后面就可以滑回去了肴颊,代碼如下:
<android.support.v4.widget.DrawerLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/drawerlayout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true">
...(其他代碼)
<android.support.design.widget.NavigationView
android:id="@+id/navi"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="start"
android:visibility="gone"
app:headerLayout="@layout/toubuju"
app:menu="@menu/cehuamenu"/>
</android.support.v4.widget.DrawerLayout>