2
Wie kann ich die Höhe einer Kopfzeile im NavigationView
ändern? Ich habe nächsten xml: activity_main.xmlWie ändert man die Kopfhöhe in NavigationView?
<android.support.v4.widget.DrawerLayout
android:id="@+id/dlDrawerContainer"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
tools:context=".activity.MainActivity"
xmlns:app="http://schemas.android.com/apk/res-auto">
<!-- Some data -->
<!-- Drawer -->
<android.support.design.widget.NavigationView
android:fitsSystemWindows="true"
android:id="@+id/nvNavigation"
android:layout_width="wrap_content"
android:maxWidth="400dp"
android:layout_height="match_parent"
android:layout_gravity="start"
app:headerLayout="@layout/navigation_header"/>
</android.support.v4.widget.DrawerLayout>
navigation_header.xml
<ImageView xmlns:android="http://schemas.android.com/apk/res/android"
android:src="@drawable/ic_header"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:maxWidth="400dp"
android:maxHeight="100dp"
android:scaleType="matrix"/>
Aber NavigationView
ignoriert alle Dimensionsattribute und zeigen einen Header mit Standardgrößen. Wie man es repariert?
Wie kann ich wrap_content für 'ImageView' verwenden. Es funktioniert nicht mit 'NavigationView'. Meine 'ImageView' füllt die maximale Elternhöhe gleich. –
Sorry, aber ich kann nicht verstehen, was Sie erreichen möchten. Kann deine Frage bearbeiten und erklären, was das erwartete Ergebnis ist, vielleicht mit einem Bild? –