Domanda

I have an app with an action bar. I need the menu items to fill the height of the action bar. I have tried styling the action bar with android:padding="0dp" and settings android:layout_height="fill_parent" on the action views to no avail.

This picture shows that the browse subjects actionview for instance does not fill the actionbar.

enter image description here

Here is a shortened version of my menu declaration.

<menu xmlns:android="http://schemas.android.com/apk/res/android">

    <item android:id="@+id/menu_more"
          android:title="More"
          android:showAsAction="always"
          android:actionProviderClass="pacakge.action_providers.MoreProvider"
            />
</menu>

The action provider class inflates and returns a view that is inserted into the ActionBar.

Any help would be greatly appreciated! Thanks

È stato utile?

Soluzione

Ended up just hard coding the button height to 50dp. Not a very elegant solution but it works.

Altri suggerimenti

Hmm....looks like you need to use bigger icons.

Also, in the layout for the buttons, use android:layout_height as "fill_parent".

And as a last tip, use android:showAsAction="ifRoom"

Try to change menu item layout to RelavtiveLayout

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top