How to make a collapsing toolbar in android?

后端 未结 2 1719
甜味超标
甜味超标 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"
    
    0 讨论(0)
  • 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"
    
    0 讨论(0)
提交回复
热议问题