1
Die Höhe der Navigationsansicht, die ich auf "match_parent" festgelegt habe, stimmt aber nicht wirklich mit dem übergeordneten Element überein Unten ist der XML-Code:Höhe der Navigationsansicht Ich habe auf "match_parent" festgelegt, passt aber nicht wirklich zum übergeordneten Element
<?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">
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/content">
</FrameLayout>
</RelativeLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<ImageView
android:id="@+id/moveimage"
android:layout_width="50dp"
android:layout_height="50dp"
android:src="@drawable/ic_launcher"/>
</RelativeLayout>
<android.support.design.widget.NavigationView
android:id="@+id/nav_view"
android:layout_width="50dp"
android:layout_height="match_parent"
android:layout_gravity="start"
android:fitsSystemWindows="true"
android:background="#fff"
app:headerLayout="@layout/nav_header" />
</android.support.v4.widget.DrawerLayout>
Für die Höhe des navigationView, wie mache ich es den ganzen Bildschirm
der Screenshot unten an passen:
Relative Layout bietet keine Orientierung Attribut – Confuse
@Yasharyan Was Attribut Ausrichtung ist also, was soll ich ändern? –
Sie haben 2 relative Layouts. Der erste hat die Zeile 'android: orientation =" vertical "'. Entfernen Sie es. Beachten Sie, ob dies etwas behebt, aber es ist eine falsche Vorgehensweise. – Confuse