Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ActionBar Tabs - Fixed and Scrollable?

In the Android Design Guidelines it states that "There are two types of tabs: fixed and scrollable."

I can't find any documentation in the ActionBar documentation to support the ability to specify either type of tabs.

How do you specify a tab group to be fixed or scrollable? If you can't, what governs whether the tabs are fixed or scrollable exactly?

like image 639
Eurig Jones Avatar asked Apr 20 '12 09:04

Eurig Jones


1 Answers

The number of tabs dictates whether the tab group is fixed or scrollable. For example, if you have one tab, they'll be fixed but if you have like six then they'll become scrollable because all six can't fit on one screen.

If you want to see it in action on a pre-3.0 device, download the Action Bar Sherlock sample and select Feature Toggles from the main list and then select "Tabs" as your navigation mode. Now you can add tabs to the bar and at first, they'll get smaller to cram them all in and then once you have enough you can scroll through them.

UPDATE: There is now a page on this in the official documentation that says "Fixed tabs are displayed with equal width, based on the width of the widest tab label. If there is insufficient room to display all tabs, the tab labels themselves will be scrollable." Read more here.

like image 177
MrEngineer13 Avatar answered Oct 24 '22 18:10

MrEngineer13