Show and hide Action bar while scrolling view pager content

后端 未结 3 1925
伪装坚强ぢ
伪装坚强ぢ 2021-02-04 08:51

I want to show and hide the action bar /toolbar as the Google Play store app. I am using sliding tabs on top and view pager to show the content of each tab. Here is the screens

相关标签:
3条回答
  • 2021-02-04 09:41

    Check this example to implement this with the new official Android Design Support Library:

    https://github.com/chrisbanes/cheesesquare

    0 讨论(0)
  • 2021-02-04 09:44

    Have a look at this:

    https://github.com/flavienlaurent/NotBoringActionBar

    There's a trick involved here. You'll need to:

    1. Wrap your layout in a list view
    2. Add a fake header with the same height as your action bar large header
    3. set your action bar overlay to true
    4. Translate the real header when the list moves (i.e. when the fake header is scrolled).

    It's a little bit complicated at first but once you understand it, you see how smart and obvious it all is. The link will give you all you need I hope.

    I myself used that link to implement it in my own app and it works great.

    0 讨论(0)
  • 2021-02-04 09:50

    Checkout this library: https://github.com/ksoichiro/Android-ObservableScrollView

    this will definitely help you

    0 讨论(0)
提交回复
热议问题