Rich
Rich

Reputation: 4207

Not Too Happy with the Android Action Bar... How Can I Reduce Its Size

I don't really like the new Action Bar Android has come up with -- and apparently forced me to use in later API levels. But, since it appears I'm stuck with it -- I have no more Menu Button and I need the functionality I've lost, I'd like to minimize the annoyance factor.

Can anybody tell me how NOT to display the Icon/Logo? It's easy enough to suppress the Title, but the logo is still too much -- and provides zero helpfulness.

Also, can anybody tell me how to reduce the height of the bar? Currently, it's about about 1/4" (about half a centimeter for you metric types), but that's easily twice as large as it needs to be -- especially if I can ditch the graphics.

Finally, there's a big empty black space between the left side of my screen and the first menu item. This wouldn't bother if my five menu items fit on the display, but naturally they don't. Does anybody know how to encourage my software to push the menu items a tad to the left so they fit??

Thanks,
R.

Upvotes: 4

Views: 2410

Answers (3)

krsteeve
krsteeve

Reputation: 1804

You actually can remove the action bar:

ActionBar actionBar = getActionBar();
actionBar.hide();

Upvotes: 1

Vincent Mimoun-Prat
Vincent Mimoun-Prat

Reputation: 28541

Why don't you simply hide the action bar and provide your own menu in your activity layout? Seems to me that you want to fit a square in a disc ...

Just use the ActionBar for what it is meant to be used. If you don't like it, hide it and make your own control.

I mean, no title, no left side icon, ... Then what's the point of using it?

Upvotes: 2

Cat
Cat

Reputation: 67502

You can use getActionBar().setDisplayShowHomeEnabled(false) to get rid of the button.

As for the height of the Action Bar, I don't believe it can be changed without setting up a new theme. In Android's Theme.Holo, it has an attribute <item name="actionBarSize">56.0dip</item>. You should be able to change this if you extend that theme into your own. (Keep in mind that this may denigrate the UX since people are expecting it to be of a certain size.)

As for your last question, I believe icon spacing is fixed. Can you show exactly what you mean by "a big empty black space"? They should be evenly distributed across the bar.

Upvotes: 7

Related Questions