charles
charles

Reputation: 69

Tabs to span multiple rows

can anyone point me in the right direction for making an android layout that has multiple rows of tabs? i have about 15 tabs that are unreadable when the app opens.

Upvotes: 2

Views: 1688

Answers (2)

I wanted to do something similar with tabs in different rows and couldn't find an easy way to do it with TabHosts, so I ended up using Fragments.

You can use the FragmentActivity to lay out your tabs (or buttons) however you want and then use Fragments to switch out the main view with a FragmentManager in the tab's OnClickHandler.

Upvotes: 0

Kocus
Kocus

Reputation: 1613

Well, sometime ago I ended in the same problem. My conclusions:

  • AFAIK you cannot (correct me, if I wrong) create two/three layered tabs using TabHost/TabWidget.
  • You can create tabs in a HorizontalScrollView. This way, there will be 1 row of the tabs, but they will be horizontal scrollable.
  • You can create TabHost, but make your own TabWidget using buttons with selectors (which may look exactly the same like the system tabs), placed in e.g. FrameLayout. Then you can use TabHost.setCurrentTab() method to achive tab-like behaviour.

Upvotes: 1

Related Questions