Action bar tabs fill width - android

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);

Related

How to make custom tabs android

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.

ActionBarSherlock Tabs landscape width

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

ActionBarSherlock tab height not adjustable on Jelly Bean

I am creating an application with ActionBarSherlock and using ActionBar tabs. Below is how I am defining tabs:
actionBar.addTab(actionBar.newTab().setText("test").setTabListener(new TabListener<AccountsListFragment>(this, "accounts",AccountsListFragment.class)));
I am trying to change the height of the tabs. From what I understand there is no way to change just the height of the tabs. You also have to change the height of the main action bar(I am pulling my definition of the main action bar from)
http://developer.android.com/design/patterns/actionbar.html#considerations-split-action-bars
So how you change the height of the action bar is using the below style inside the main theme
<item name="actionBarSize">100dp</item>
<item name="android:actionBarSize">100dp</item>
The above code seems to work on all devices to change both the Main action bar and the tabs except jellybean. I tested this on a 4.1.2 galaxy nexus. Also on a 4.2 Nexus 7. It seems to work the same on both. It only changes the main action bar and not the tab height at all.
We also tried a custom view for the tabs which did not help us.
If anyone can point me to where in google it says that they do not allow changing height of tabs anymore(Which I doubt is the case) or give me a style to fix this issue. I would greatly appreciate it. If you even give me an example on a normal action bar and not sherlock that should help me.
To me it sounds like a silent bug fix. They make some of these at every new release. I doesn't make sense that changing the height of the actionbar should increase the size of the tabs and it isn't something that has been encouraged by Google, rather it's a hack developers have found nice to use. Your only other option is to make it yourself, but it's quite complex and could prove to be time consuming.
Similar post here:
Change Actionbar height on Android JellyBean

Android change of ActionBar tab from some width

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

ActionBar Tab Width

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

Categories

Resources