We are building an Android 4.0 app with tabbed navigation at the top. This all works great in portrait mode but when the application changes to landscape mode (which we want to support), the default behaviour is for the tabs to move up into the top/action bar which seems to eliminate the ability to have a screen title shown and seems crowded with the actions that appear on the right of the top/action bar.
What is the best approach to prevent this and how difficult would it be to override this default behaviour?
Related
Working on re-designing an application that is Android and is used in Landscape mode.
Want to be able to have the user 1 click to navigate.
It currently has tabs on the left side (basically a bottom nav bar on the left)
Can't find resources that say anything about navigation bar on Tablet Landscape mode.
Anyone have creative ideas or examples of how people do it?
Thanks!
I am unsure what to search for this so all links are appreciated.
When I change the orientation of my device to portrait mode all the tabs are going below the action bar, not on it, even though there is plenty of room (I am using 2 tabs while testing on a Nexus 10). Will the tabs always appear below the action bar in portrait mode or is there a way around this?
What I want to happen:
(source: android.com)
What is happening: NOTE: this is the behavior I am getting even when there is PLENTY of room to display the tabs in the action bar:
(source: android.com)
Thanks in advance!
Will the tabs always appear below the action bar in portrait mode
On small/normal screens, yes. Action bar tabs will go where the action bar implementation wants to put them... which includes them not being tabs at all in some cases, but a drop-down list instead.
I want to display Tabs below Android Action Bar in Landscape mode
I have set
actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS);
I tried android:uiOptions="splitActionBarWhenNarrow" in Android manifest but everything seems to be OK in Portrait. But when view changes to Landscape, the tabs get embedded inside action bar.
Anyone has implemented this, because this does not seem to work.
OS - ICS and above.
This is correct behaviour. It's Split-Action-Bar-When-Narrow option and there are no options how to determine which actions will be displayed at top and which at bottom. ActionBar element is doing this according to screen orientation and screen resolution. Use your own toolbar.
I am creating an app that will always run in landscape. On tablets the system navigation bar is placed horizontally at the bottom of the screen, and on the phones it is placed vertically at the right end of the screen.
My question is if it is possible to control the placement of the navigation bar via a flag or with some code. I would like it to always appear either at the bottom, or to the right of the screen consistently, regardless of the device.
I have a number of tabs on the ActionBar and I want to find a way to handle those when the tablet is put into portrait mode. Currently, if you have more than 3-4 and any showing menu items, any more tabs will be cut off and unavailable. I'm wondering if there's a way to have those overflow into a "more" tab automatically. Or, if there's a way to have physical tabs and a drop down list for extra options as the last "tab". Has anyone encountered this scenario yet?
I would do one of the following if I were developing the app that required a use case with a high count of tabs:
Override onConfigurationChanged to detect when in portrait mode and hide the text on the tabs leaving only the icon. Using themes you can also adjust the padding of the tab contents.
Override onConfigurationChanged to detect when in portrait mode and switch the navigation be list-based. This will provide you with more room for action items while still showing the current "tab" that the user is on.
Implement a custom navigation view which responds to portrait in whatever manner you would like (e.g., scrolling horizontally, presenting only the selected tab with text, showing only the selected tab with an overflow-style button for the additional ones).
From http://developer.android.com/sdk/android-4.0.html#ActionBar
The ActionBar has been updated to support several new behaviors. Most importantly, the system gracefully manages the action bar’s size and configuration when running on smaller screens in order to provide an optimal user experience on all screen sizes. For example, when the screen is narrow (such as when a handset is in portrait orientation), the action bar’s navigation tabs appear in a “stacked bar," which appears directly below the main action bar.
Yay!