मेरे पास नेविगेशन ड्रॉवर के साथ एक गतिविधि है जो गतिविधि पर main_fragment_container को प्रतिस्थापित करती है। जब टुकड़ों में से एक प्रदर्शित होता है तो मैं टूलबार के लेआउट को बदलना चाहता हूं और इसमें एक स्पिनर जोड़ना चाहता हूं (और जब खंड छिपा हुआ है तो उसे हटा दें)।प्रदर्शित खंड के अनुसार टूलबार लेआउट को बदलें
मेरे लेआउट है कि तरह लग रहा है:
<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>
यह टूलबार के नीचे दराज खोल देगा। [नेविगेशन ड्रॉवर को सामग्री डिजाइन में निर्दिष्ट किया गया है] (http://www.google.com/design/spec/patterns/navigation-drawer.html) टूलबार को ओवरलैप करने के लिए (लेकिन इस समय Google Play भी ऐसा नहीं करता है)। – Tapirboy
मैंने इसे उद्देश्य पर किया, मेरे डिजाइन में दराज टूलबार पर होने पर अच्छा नहीं दिखता है। – Idob