Freitag, 20. Dezember 2013

Action Bar UI TAB NAVIGATON


Since Android 3.0 there was added a window feature to the API called "action bar"  (Design Patterns).
The action bar provides two navigation modes: tabs and drop-down-list.

Before you start to develop an app you make some basic decisions about the UI Design.
If you decide to use the action bar with "NAVIGATION_MODE_TABS" you have to make you familiar with the android system and how it handles this navigation mode:
Sometimes action bar tabs are showing as drop-down-list, this behaviour can be helpful to save space.
But it's also annoying if you expect tabs and the system shows a drop-down-list (this issue is tracked here; good explanation on SO by CommonsWare).

Now, how to solve this issue?
  • first you have to think about your UI layout and if you really want to show always tabs you have to take a "ViewPager" with "PagerTabStrip".
  • if you already developed an app there are some workarounds (described in this post ): one of this is very simple: just set the navigation mode of the action bar after you're adding the tabs.

Keine Kommentare:

Kommentar veröffentlichen