Fester Navigationsheader in der Navigationsleiste beim Scrollen durch Elemente
AKTUELLEN ZUSTAN: NavigationDrawer mit Elementen für NavigationHeader und NavigationMenu. Die Anzahl der Elemente ist groß, daher ist ein Bildlauf erforderlich, um auf die Elemente nach unten zuzugreifen.
ANFORDERUN: Beim Scrollen nach unten sollte der NavigationHeader fixiert bleiben
Hier ist meine activity_main-Layoutdatei
<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_main"
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"
android:background="#00000000"
app:headerLayout="@layout/nav_header_main"
app:menu="@menu/activity_main_drawer"
/>
</android.support.v4.widget.DrawerLayout>
Hier ist meine navigation_header_main-Layoutdatei
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="100dp"
android:orientation="vertical"
android:background="#3d3b3b"
android:theme="@style/ThemeOverlay.AppCompat.Dark">
<android.support.v7.widget.AppCompatImageView
android:layout_width="match_parent"
android:layout_height="100dp"
android:src="@drawable/categories"
android:padding="1dp"
/>
</RelativeLayout>
P.S Ich bin neu bei Android Dev. Bitte fordern Sie bei Bedarf weitere Ressourcen an