Using windowTranslucentStatus with CollapsingToolbarLayout

前端 未结 7 1604
南旧
南旧 2020-12-14 06:09

I\'m trying to get a similar effect to what is seen on google play.

I\'ve got the below layout to show a transparent toolbar with an image behind it. When the user s

7条回答
  •  暖寄归人
    2020-12-14 06:48

    Once the status bar is transparent and the free to use by the activity, the toolbar is pushed top to occupy that space. To fix this you need to manually move the toolbar to the original spot.

    Add the below tags to the "android.support.v7.Widget.Toolbar" view :

    android:layout_height="48dp" // Whatever the height of the toolbar you want
    android:layout_marginTop="-48dp" // Negative of the height of the toolbar
    

提交回复
热议问题