I've been trying to find out how to edit the tab width in the action bar.
I'm running an app on my Gnexus and although the tabs in Portrait are of satisfying width, I'd like them to be wider in Landscape mode.
You can do this by applying different styles in your application. This question
Android - customizing actionbar sherlock tabs
mentions your problem very detailed.
greetings
Related
I'm implementing android tabs in the actionbar but seems when displaying the screen on tablet i have a weird issue.
The tabs look like this:
Does anyone knows a fix or a workaround so the tabs can fill the width of the actionbar?
This simple setting works for me:
getActionBar().setNavigationMode(ActionBar.NAVIGATION_MODE_TABS);
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.
How do i make a tab bar look like this:
Yes, this is the tab of contact app of android 4.2.2 on samsung galaxy s3.
This is what I have so far:
As you can see, the height of the tabs is a bit low so the indicator override the text. So I need to increase the tab bar height.
The problem is I can't increase the height of the tabs further. Because of new android policy that limit tabs height ( it is explained here: Change Actionbar height on Android JellyBean).
Then how did google do that? Is there any tutorial to make a custom tab bar, or is there a trick to by pass limit of tab bar height?
Thank you very much for reading my quesion.
Im using actionbarsherlock tab navigation and they work fine.
The only problem im having is that when going in landscape mode the tabs dont fill the whole width of the screen and are small unlike in portrait.
I been looking at styling the tabs but i cannot find the right setting to make the tabs wider.
What do I need so the tabs can fill the width on the screen in landscape
It seems that the only way to do this is using a custom view. Check this out:
Set menu items centered and full-width with ActionBarSherlock
I have one tough question. I am now playing with design of the Android application and I have the problem with way how the tabs are displaying from some width of display. I use ActionBarSherlock library and ViewPager for tabs.
The problem is that I use yellow color for ActionBar, black for tabs and again yellow for tab indicators, but when I look at the application on wider screen or in landscape mode (I guess approximately from width 400dp) I can't see the indicators, because tabs are hiden in action bar and indicator has exactly the same color. Is there som way how to change color of tab indicators from some display width?
I have tried to do it by making of layout-sw400dp/layout.xml, new 9patche's and new styles, but I can't make it work this way and I think now that it is impossible to do it this way. Do you have any idea how to do this?
Thank you very much in advance.
UPDATE
I have solved it in the following way. I have created folders drawable-w400dp and drawable-land (for ancient phones). Only phones where it will probably be displayed in the wrog way are black berry like androids.
Have you tried using the Action bar style generator. I used this and my tabs have highlights in both orientations http://jgilfelt.github.com/android-actionbarstylegenerator/ it generates 9patches and XML for you