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

有帮助吗?

解决方案

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

其他提示

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

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top