コーディネータレイアウトに問題があります。私は、親CoordinatorLayout(私はツールバーを非表示にしたい)とappBarLayout内のアクティビティツールバーを持っていて、appBarLayoutとviewPagerの中にtablayoutでフラグメント化しています。ここでは、アクティビティのXMLアクティビティ外のコーディネータレイアウト内のtablayoutを非表示にする
<?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>
あり、それは、私はツールバーがどこかにある。このような状況を持って、今のフラグメントのXML
<?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>
です。
私は、リニアレイアウトに活動内部コーディネーターのレイアウトを変更した場合、私は目に見えるツールバーが、あなたがいない隠しオプションで想像できるよう得ます。あなたが確認することができますので、私はそれがどのように動作するかを少し理解している、https://github.com/Iamtodor/toolbars :)
- 隠しといくつかの例など、視差およびその他のツールバーを示す:
実は、私がコーディネーターと遊ぶいるが、多くのレイアウトhttps://github.com/codepath/android_guides/wiki/Using-the-App-ToolBar#using-toolbar-as-actionbar - - - https://github.com/codepath/android_guides/wiki/Handling-Scrolls-with-CoordinatorLayout https://github.com/chrisbanes/cheesesquare
をしかしtablayoutは、ツールバーと同じappbarlayoutの内側に存在する場合、すべての例があります:また、私はこのソースをwantchました。
どうすれば修正できますか?ここで
はまだ答え – iamtodor
UPを探して、それは可能ですしてください? – iamtodor
私も同様の問題があります。私は何を見つけるのか教えてくれます。 – dazza5000