How to use a TabLayout with Toolbar inside CollapsingToolbarLayout?

后端 未结 18 2325
逝去的感伤
逝去的感伤 2020-11-27 11:46

I am looking at the chrisbanes/cheesesquare and I am trying to put TabLayout with a Toolbar inside a CollapsingToolbarLayout, and here is my code



        
18条回答
  •  盖世英雄少女心
    2020-11-27 12:09

    collapsing toolbar with tabs using new material design support library example with source code

    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

提交回复
热议问题