问题
I want the Toolbar to always be visible and have the TabLayout get scrolled away and quick return but this combination seems impossible.
<CoordinatorLayout>
<AppBarLayout>
<CollapsingToolbarLayout layout_scrollFlags="scroll|exitUntilCollapsed">
<TabLayout/>
<Toolbar layout_collapseMode="pin" />
</CollapsingToolbarLayout>
</AppBarLayout>
<ViewPager/>
</CoordinatorLayout>
This makes my Toolbar not scroll away, but it makes the TabLayout only return when scrolled to the top of the list.
Changing to scroll|enterAlways
on the CollapsingToolbarlayout makes the Toolbar scroll away too.
回答1:
A solution was to have the CollapsingToolbarLayout
have these scroll flags.
app:layout_scrollFlags="scroll|exitUntilCollapsed|enterAlways"
But the shadow is missing..
来源:https://stackoverflow.com/questions/39142960/collapsingtoolbarlayout-keep-toolbar-but-hide-tablayout-with-quick-return