0

Possible Duplicate:
How to implement horizontally scrollable tabs?

I would like to implement tabs in an app that essentially also allows swiping between two screens. A good example would be in the App section in the Google Play store. There are horizontal scrollable tabs up top and they move as the screen scrolls.

I am targeting Android 4.0 with this but need to make it backwards compatible.

I am obviously not asking anyone to write the entirety of code on this, I simply am looking for a tutorial somewhere, or advice on how to go about starting this. The Dev site show exactly what I want here: http://developer.android.com/design/building-blocks/tabs.html

But doesn't show HOW to do this (or at least make it visibly clear); it only says that's its good practice to do.

Community
  • 1
  • 1
TheLettuceMaster
  • 15,594
  • 48
  • 153
  • 259

2 Answers2

1

take a look at this API, I use it and its very easy to implement

ViewPagerIndicator

tyczj
  • 71,600
  • 54
  • 194
  • 296
0

This is usually done by using ViewPager class. In order to make it backward compatible take a look at the ActionBarSherlock project; there you will find examples on how to implement this kind of design pattern and make it work even on Android 1.6.

Also, as Alex said, you can take a look at the ViewPageIndicator project of the same developer if you don't want to care about an action bar.

Cristian
  • 198,401
  • 62
  • 356
  • 264