2017-04-15 3 views
1

이 질문은 이전에 물어 보았지만 AndroidStudio의 최신 버전에서와 같이 변경되었습니다. Eitehrways, 오래된 해결책은 작동하지 않는 것처럼 보입니다. 아니면 잘못된 것을하고 있습니다.탐색 표시 줄 아래에 탐색 표시 줄을 만드는 방법은 무엇입니까?

XML : 귀하의 DrawerLayout

<?xml version="1.0" encoding="utf-8"?> 
<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/drawer_layout" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    android:fitsSystemWindows="true" 
    tools:openDrawer="start"> 

    <include 
     layout="@layout/app_bar_homescreen" 
     android:layout_width="match_parent" 
     android:layout_height="match_parent" 
     /> 

    <android.support.design.widget.NavigationView 
     android:id="@+id/nav_view" 
     android:layout_width="wrap_content" 
     android:layout_height="match_parent" 
     android:layout_gravity="start" 
     android:fitsSystemWindows="true" 
     app:menu="@menu/activity_homescreen_drawer" /> 

</android.support.v4.widget.DrawerLayout> 

답변

2

레이아웃에서 앱 바 이상은, 그러므로 그 위에 그립니다. 이것은 App Bar이 근무 탐색 서랍

+0

오의 "위에"그려 질 수 있습니다

<FrameLayout 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" ... > <include layout="@layout/app_bar_homescreen" ... /> <android.support.v4.widget.DrawerLayout ...> ... rest of your XML layout </DrawerLayout> </FrameLayout> 

:

당신은 같은 것을 할 필요가있다. 전에 시도하지 않은 이유는 android : fitsSystemWindows가 true로 설정 되었기 때문입니다! – newToEverything

관련 문제