문제

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