Ended up just hard coding the button height to 50dp. Not a very elegant solution but it works.
Make menu items fill height of action bar
-
10-03-2022 - |
문제
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.
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
해결책
다른 팁
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