Ich habe eine Aktivität mit Navigationsschublade, die den main_fragment_container für die Aktivität ersetzt. Wenn eines der Fragmente angezeigt wird, möchte ich das Layout der Symbolleiste ändern und ein Drehfeld hinzufügen (und es entfernen, wenn das Fragment ausgeblendet ist).Symbolleistenlayout entsprechend dem angezeigten Fragment ersetzen
Mein Layout sieht wie folgt aus:
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:sothree="http://schemas.android.com/apk/res-auto"
android:id="@+id/main_parent_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:fitsSystemWindows="true">
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
sothree:theme="@style/AppTheme.ActionBar" />
<android.support.v4.widget.DrawerLayout
android:id="@+id/drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent">
<!-- Main layout -->
<FrameLayout
android:id="@+id/main_fragment_container"
android:layout_width="match_parent"
android:layout_height="match_parent" />
<!-- Nav drawer -->
<fragment
android:id="@+id/fragment_drawer"
android:name="com.idob.mysoccer.ui.DrawerFragment"
android:layout_width="@dimen/navigation_drawer_width"
android:layout_height="match_parent"
android:layout_gravity="left|start" />
</android.support.v4.widget.DrawerLayout>
Dies würde die Schublade unter der Symbolleiste öffnen. [Die Navigationsleiste ist in Material Design] (http://www.google.com/design/spec/patterns/navigation-drawer.html) angegeben, um die ToolBar zu überlappen (was Google derzeit jedoch nicht tut). – Tapirboy
Ich habe es mit Absicht gemacht, in meinem Design sieht die Schublade nicht gut aus, wenn es über der Symbolleiste ist. – Idob