0

Ich habe eine Schublade, die auf einem großen Gerät funktioniert, aber nimmt den gesamten Bildschirm auf einem kleineren Gerät, ich habe versucht, ein Gewicht, aber ohne Erfolg, vielleicht implementieren ich es falsch? Code unten. Hilfe geschätzt, danke.Schubladengröße angeben - Xamarin Android

Ohne Gewicht

<?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" 
android:id="@+id/drawer_layout" 
android:orientation="vertical" 
android:layout_width="fill_parent" 
android:layout_height="fill_parent" 
android:fitsSystemWindows="true"> 

<android.support.design.widget.NavigationView 
android:id="@+id/nav_view" 
android:layout_height="match_parent" 
android:layout_width="325dp" 
android:layout_gravity="start" 
android:fitsSystemWindows="true" 
app:menu="@menu/drawer_view" /> 
</android.support.v4.widget.DrawerLayout> 

Mit Gewicht, aber immer noch nicht

<?xml version="1.0" encoding="utf-8"?> 
<android.support.v4.widget.DrawerLayout 
xmlns:app="http://schemas.android.com/apk/res-auto" 
android:id="@+id/drawer_layout" 
android:orientation="vertical" 
android:layout_width="fill_parent" 
android:layout_height="fill_parent" 
android:weightSum="2" 
android:fitsSystemWindows="true"> 

<android.support.design.widget.NavigationView 
android:id="@+id/nav_view" 
android:layout_height="match_parent" 
android:layout_width="0dp" 
android:layout_weight="1" 
android:layout_gravity="start" 
android:fitsSystemWindows="true" 
app:menu="@menu/drawer_view" /> 
</android.support.v4.widget.DrawerLayout> 

Antwort

0

Dies ist eine vollständige Implementierung von Layoutcode NavgiationView.

<?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" 
android:id="@+id/drawer_layout1" 
android:layout_width="match_parent" 
android:layout_height="match_parent" 
android:fitsSystemWindows="true"> 
<LinearLayout 
    android:orientation="vertical" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent"> 
    <include 
     android:id="@+id/cin7toolbar" 
     layout="@layout/toolbar" /> 
    <FrameLayout 
     android:id="@+id/flContentSecure" 
     android:layout_width="match_parent" 
     android:layout_height="match_parent" /> 
</LinearLayout> 
<android.support.design.widget.NavigationView 
    android:id="@+id/navigation1" 
    android:layout_width="wrap_content" 
    android:layout_height="match_parent" 
    android:layout_gravity="start" 
    app:headerLayout="@layout/nav_header" 
    app:menu="@menu/nav_menu_secure" /> 
</android.support.v4.widget.DrawerLayout> 

Hoffnung, die für Sie arbeitet.