Tabs fixed with android.support.v4.view.PagerTabStrip or ViewPagerIndicator

In my application, I have a Sherlock ActionBar with smooth navigation ("ActionBar.NAVIGATION_MODE_LIST"). In one action, I have two fragments that should switch through tabs. What I did now was to put the fragment loading in the ViewPager ("android.support.v4.view.ViewPager") along with "android.support.v4.view.PagerTabStrip" to switch between the fragment tabs.

My problem is that these are horizontal scrollable tabs. Similarly, like Jake Whartons viewpageindicator ( viewpagerindicator.com ). But I want the two fixed tabs to be next to each other. How is this possible in the support library or using the viewpage function?

For wording see http://developer.android.com/design/building-blocks/tabs.html

+4
source share
1 answer

But I want the two fixed tabs to be next to each other. How is this possible in the support library or using the viewpage function?

You will need to write your own indicator. Or you can use the tabs of the action bar in conjunction with the ViewPager , but this will contradict the existing navigation in the action bar, and you cannot be relied on to give you tabs anyway.

Since the tabs will scroll meaningfully if they are too large for the screen, I personally would not worry about this problem.

0
source

All Articles