How to make a collapsing toolbar in android?

后端 未结 2 1745
甜味超标
甜味超标 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:50

    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"
    

    And finally You missed one attribute for NestedScrollView.

    app:layout_behavior="@string/appbar_scrolling_view_behavior"
    

提交回复
热议问题