Home » Android » android – ActionBarSherlock tab height not adjustable on Jelly Bean

android – ActionBarSherlock tab height not adjustable on Jelly Bean

Posted by: admin June 15, 2020 Leave a comment


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

How to&Answers:

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