2016-01-05 3 views
0

Он использует NavigationView с поддержкой библиотеки android.support.design.widget. Он работает очень хорошо, но я не могу настроить высоту и поля, а затем остается пустое пространство между панелью инструментов и первой строкой. Чтобы понять проблему, см. Изображение. Это мой XML. Спасибо за вашу помощь.Android DrawerLayout height

<LinearLayout 
xmlns:android="http://schemas.android.com/apk/res/android" 
xmlns:app="http://schemas.android.com/apk/res-auto" 
android:layout_width="match_parent" 
android:layout_height="match_parent" 
android:fitsSystemWindows="true" 
android:orientation="vertical"> 

<include 
    android:id="@+id/toolbar_actionbar" 
    layout="@layout/toolbar_default" 
    android:layout_width="match_parent" 
    android:layout_height="wrap_content"/> 

<android.support.v4.widget.DrawerLayout 
    xmlns:android="http://schemas.android.com/apk/res/android" 
    xmlns:tools="http://schemas.android.com/tools" 
    xmlns:app="http://schemas.android.com/apk/res-auto" 
    android:id="@+id/drawer" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    android:fitsSystemWindows="true" 
    tools:context=".MainActivity"> 


    <FrameLayout 
     android:id="@+id/frame" 
     android:layout_width="match_parent" 
     android:layout_height="match_parent"> 

    </FrameLayout> 


    <android.support.design.widget.NavigationView 
     android:id="@+id/navigation_view" 
     android:layout_height="match_parent" 
     android:layout_width="wrap_content" 
     android:layout_gravity="start" 
     app:menu="@menu/main"/> 
    <!-- app:headerLayout="@layout/header" --> 
</android.support.v4.widget.DrawerLayout> 

toolbar_default

<?xml version="1.0" encoding="utf-8"?> 
<android.support.v7.widget.Toolbar 
    style="@style/ToolBarStyle" 
    xmlns:android="http://schemas.android.com/apk/res/android" 
    android:layout_width="match_parent" 
    android:layout_height="wrap_content" 
    android:background="?attr/colorPrimary" 
    android:minHeight="@dimen/abc_action_bar_default_height_material" 
    /> 

enter image description here

+0

положить код макет = "@ макет/toolbar_default" меню –

+0

Я редактировал мой сообщение – user2847219

+0

Добавить код для "@ style/ToolBarStyle" – Msp

ответ

0

Попробуйте добавить это к вашему dimens.xml,

<dimen name="design_navigation_separator_vertical_padding">0dp</dimen> 
+0

нет, к сожалению ничего не изменилось. Я также пробовал: android: minHeight = "0dp" – user2847219