Collapsing ToolBar Layout with viewpager

前端 未结 5 1181
旧时难觅i
旧时难觅i 2021-02-02 12:43

I am using CollapsingBarLayout with viewpager and the fragments of viewpager are having listview, gridview.

Here is my code:

    

        
5条回答
  •  情深已故
    2021-02-02 13:16

    collapsing toolbar with tabs using new material design support library

    I used official collapsing toolbar feature of new material design support library.

    here collapsed view height is 256dp and tabs height is 56dp

    i made following path

    i cut image into two parts one for collapsed view and one for tabs.

    i cutted images according to dp to pixel sizes with high resolution drawable xxxhdpi and put into drawable folder so it will adjustable to all screen sizes

    i have 2000x1246 image

    top image 256dp= 2000x1024 pixel

    bottom tab image 56dp= 2000x224 pixel

    Here is the complete example with source code

提交回复
热议问题