How to make a collapsing toolbar in android?

后端 未结 2 1718
甜味超标
甜味超标 2021-01-20 05:09

so im trying to implement a simple collapsing toolbar, but I don\'t think my xml layout is correct. The text is appearing the image and when I scroll down, I can\'t scroll b

2条回答
  •  抹茶落季
    2021-01-20 05:38

    in your ImageView, add the following attribute:

    app:layout_collapseMode="parallax"
    

    Also, in your NestedScrollView tag, add the following:

    app:layout_behavior="@string/appbar_scrolling_view_behavior"
    

提交回复
热议问题