我不知道发生了什么,但是当我在第一个片段中加载数据并向下滚动时,工具栏会按预期折叠,但是当我向上滚动工具栏时出现但没有内容可见(图1)并且当我切换制表符时应该出现(图2)
这是代码
<android.support.design.widget.AppBarLayout
android:id="@+id/appbar_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fitsSystemWindows="true"
android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar">
<android.support.design.widget.CollapsingToolbarLayout
android:id="@+id/collapsing_toolbar"
android:layout_width="match_parent"
android:layout_height="200dp"
android:fitsSystemWindows="true"
android:minHeight="?attr/actionBarSize"
app:contentScrim="@color/primary"
app:expandedTitleMarginEnd="64dp"
app:expandedTitleMarginStart="48dp"
app:expandedTitleTextAppearance="@style/TransparentText"
app:layout_scrollFlags="scroll|enterAlwaysCollapsed|enterAlways">
<android.support.v4.view.ViewPager
android:id="@+id/image_view_pager"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
app:layout_collapseMode="parallax" />
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:layout_gravity="top|bottom"
android:background="@color/transparent"
app:contentScrim="@color/primary"
app:layout_collapseMode="pin"
android:title="Glimray"
android:titleTextColor="@color/dark_tone"
/>
</android.support.design.widget.CollapsingToolbarLayout>
<android.support.design.widget.TabLayout
android:id="@+id/tabs"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:layout_gravity="bottom"
android:background="@color/dark_tone"
android:minHeight="?attr/actionBarSize"
app:layout_scrollFlags="scroll|enterAlways"
app:tabGravity="fill"
android:fitsSystemWindows="true"
app:tabIndicatorColor="@color/primary"
app:tabMode="fixed" />
</android.support.design.widget.AppBarLayout>