user2499946
user2499946

Reputation: 689

Android ActionBar and Tabs woes

I'm attempting to use tab & spinner navigation in ActionBar for my chat application, and I'm having really hard time getting it working.

First of all why is there no callback to inform me when Android switches to spinner navigation mode (is there any dirty way to do this?)?

Secondly, I cannot understand why the spinner NEVER appears for me when I am in portrait mode? To my mind the portrait mode would be the one to benefit from the spinner, not the landscape mode (where it currently seems to only appear)!

Thirdly, I cannot understand how I can customize the spinner with a custom adapter (which sets icons and other stuff), when I am in NAVIGATION_MODE_TABS mode? Is this even possible?

Fourthly, has anyone else been bitten by this bug: https://code.google.com/p/android/issues/detail?id=41392

Unfortunately, the workaround does not work for me. :(

I know of ActionBarSherlock, and I don't know if it fixes these problems, but I'm not planning to use it for now!

Thanks.

Upvotes: 2

Views: 355

Answers (1)

CommonsWare
CommonsWare

Reputation: 1006674

Secondly, I cannot understand why the spinner NEVER appears for me when I am in portrait mode?

Use NAVIGATION_MODE_LIST instead of NAVIGATION_MODE_TABS to always have a drop-down list. Conversely, if you always want tabs, don't use action bar tabs. Use something else, such as ViewPager with PagerTabStrip (or TabPageIndicator from ViewPagerIndicator, or PagerSlidingTabStrip).

Thirdly, I cannot understand how I can customize the spinner with a custom adapter (which sets icons and other stuff), when I am in NAVIGATION_MODE_TABS mode? Is this even possible?

Not as far as I am aware.

Upvotes: 3

Related Questions