10

I've created a ViewPager. and I want to add scrollable tabs (swipey tabs) to make it more flexible (like google play). and all the tutorials that i found using ActionBar. How can i do it without using ActionBar?

IBRA
  • 1,035
  • 3
  • 20
  • 50

2 Answers2

11

PagerTabStrip and the tab flavor of ViewPagerIndicator should both give you swipey tabs.

CommonsWare
  • 910,778
  • 176
  • 2,215
  • 2,253
  • The second link it seems to me it's using actionbar. not sure. but anyway I guess PagerTabStrip is what i need.thanks for your help :) – IBRA Jan 31 '13 at 14:24
  • 1
    @IbrahimSwaiss: "The second link it seems to me it's using actionbar." -- ViewPagerIndicator is for use with `ViewPager` (that's why it is called ViewPagerIndicator) and has nothing directly to do with the action bar. The author of ViewPagerIndicator is the author of ActionBarSherlock, though. – CommonsWare Jan 31 '13 at 14:26
  • it's more clear now, and thanks again, i just found what i'm looking for. wish me luck ;) – IBRA Jan 31 '13 at 14:33
  • Can anybody please give the code(xml & java) for this.. I'm still not able to figure out, on how to use ViewPagerIndicator with PagerTabStrip. Also, I think ViewPagerIndicator cannot be customized unless we are using an ActionBar. – Pranav Mahajan Jul 22 '14 at 14:22
  • `PagerTabStrip` how to make it look like `Tabs` as in `FragmentTabHost/TabHost`? – Muhammad Babar Oct 14 '14 at 11:02
3

This link will be helpful to you and you achieve that by following the example explained in the tutorial.

Or

You can search for SupportV4Demos in Samples and you can find the example FragmentTabs and Pager example to achieve that.

TNR
  • 6,014
  • 3
  • 30
  • 61
  • What i need is to make the tabs swipe with ViewPager, the example that you gave doesn't has swipey tabs. and thanks for your help, really appreciated :) – IBRA Jan 31 '13 at 13:59
  • @IbrahimSwaiss why to swipe tabs, when you swipe the screens, it automatically tabs get swiped. – TNR Jan 31 '13 at 14:03