How to implement a horizontal scroll / swipe between Fragments?

后端 未结 2 858
醉梦人生
醉梦人生 2021-01-03 00:33

I would like to achieve a navigation in my app like Pinterest or Trello, that is, kind of three tabs to navigation + horizontal scrolling. I have made a custom tabbar for th

2条回答
  •  无人及你
    2021-01-03 00:59

    Please take a look at the duplicate question that I just answered:

    How to implement a swipe-gesture between Fragments?

    I suppose the Android ViewPager is what you are looking for:

    http://developer.android.com/reference/android/support/v4/view/ViewPager.html

    Here is a nice tutorial on how to implement it:

    http://developer.android.com/training/animation/screen-slide.html

    The basic idea is that you have multiple Fragments, each representing a different Screen. The ViewPager enables the user to swipe between the different Fragments and display different content.

提交回复
热议问题