且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何在Android中制作折叠式工具栏?

更新时间:2023-01-06 16:12:48

您的ImageView应该具有名为

Your ImageView should have attribute called

app:layout_collapseMode="parallax"

如果要将工具栏添加到布局中,则应将属性称为

If you want to add Toolbar to your Layout there should be attribute called

app:layout_collapseMode="pin"

最后,您错过了NestedScrollView的一个属性.

And finally You missed one attribute for NestedScrollView.

app:layout_behavior="@string/appbar_scrolling_view_behavior"