Ich habe derzeit ein ViewPager ein TabLayout verwenden. Ich erstelle dynamisch Elemente zum TabLayout, basierend darauf, wie viele Seiten der ViewPager hat.hinzufügen DrawerLayout zu TabLayout mit ViewPager
Ich möchte ein DrawerLayout mit einem Burger-Symbol auf der linken Seite des TabLayout hinzufügen. Dieses Burger-Icon sollte beim Scrollen des TabLayouts sichtbar bleiben.
Ich habe versucht, das DrawerLayout neben dem TabLayout mit einem übergeordneten RelativeLayout ohne Erfolg hinzuzufügen. Hier
ist, was ich tun möchte:
Hier ist die aktuelle XML:
<android.support.design.widget.CoordinatorLayout
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.support.design.widget.AppBarLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<android.support.v4.widget.DrawerLayout
android:id="@+id/drawer_layout"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<!-- Side navigation drawer UI -->
<ListView
android:id="@+id/navList"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="left|start"
android:background="#ffeeeeee"/>
</android.support.v4.widget.DrawerLayout>
<android.support.design.widget.TabLayout
android:id="@+id/tabs"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_toRightOf="@id/drawer_layout"
app:tabMaxWidth="0dp"
app:tabMode="fixed"
app:tabGravity="fill"/>
</RelativeLayout>
</android.support.design.widget.AppBarLayout>
...
...
...
</android.support.design.widget.CoordinatorLayout>