J'ai un problème avec la disposition du coordinateur. J'ai une barre d'outils d'activité dans appBarLayout avec le parent CoordinatorLayout (je veux rendre la barre d'outils cacheable) et je fragmente avec tablayout dans appBarLayout et viewPager. Voici XML de l'activitéMasquage de la mise en page à l'intérieur de la disposition du coordinateur, activité extérieure
<?xml version="1.0" encoding="utf-8"?>
<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:background="@drawable/gradient"
android:fitsSystemWindows="true">
<android.support.design.widget.AppBarLayout
android:id="@+id/toolbar_container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:theme="@style/AppTheme.AppBarOverlay">
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="?attr/colorPrimary"
app:layout_scrollFlags="scroll|enterAlways|snap"
app:popupTheme="@style/AppTheme.PopupOverlay"/>
</android.support.design.widget.AppBarLayout>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/content"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</android.support.design.widget.CoordinatorLayout>
Et c'est le XML fragment
<?xml version="1.0" encoding="utf-8"?>
<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:background="@drawable/gradient"
android:fitsSystemWindows="true">
<android.support.design.widget.AppBarLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/toolbar_container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:theme="@style/AppTheme.AppBarOverlay">
<android.support.design.widget.TabLayout
android:id="@+id/tabs"
style="@style/MyCustomTabLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:tabGravity="fill"/>
</android.support.design.widget.AppBarLayout>
<android.support.v4.view.ViewPager
android:id="@+id/viewPager"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_behavior="@string/appbar_scrolling_view_behavior"/>
</android.support.design.widget.CoordinatorLayout>
Pour l'instant, j'ai cette situation où la barre d'outils est quelque part. Si je change la disposition du coordinateur à l'intérieur de l'activité en disposition linéaire, j'obtiens la barre d'outils visible, mais comme vous pouvez l'imaginer sans option de masquage.
En fait, je dois jouer avec le coordinateur mise en page beaucoup: cacher et barre d'outils montrant dans quelques cas tels parallaxe et d'autres - https://github.com/Iamtodor/toolbars, de sorte que vous pouvez être sûr, j'ai un peu à comprendre comment cela fonctionne :)
aussi, j'avais wantch cette source: - https://github.com/codepath/android_guides/wiki/Handling-Scrolls-with-CoordinatorLayout - https://github.com/codepath/android_guides/wiki/Using-the-App-ToolBar#using-toolbar-as-actionbar - https://github.com/chrisbanes/cheesesquare
Mais il y a des exemples où tablayout existe à l'intérieur même appbarlayout avec la barre d'outils.
Comment puis-je résoudre ce problème?
Toujours à la recherche de réponse – iamtodor
UP, s'il vous plaît, est-il possible? – iamtodor
J'ai un problème similaire. Je vais vous faire savoir ce que je trouve. – dazza5000