更改操作栏溢出菜单项,通过风格的高度菜单项、高度、风格、操作

由网友(转念成空)分享简介:我们正在开发一个Android应用程序用于工业用途。我们已经增加了操作栏,文字等的大小,以帮助提高知名度和触摸目标大小。一切运作良好,但我一直无法提高操作栏溢出菜单的列表项的高度:We are working on an Android application for industrial uses. We hav...

我们正在开发一个Android应用程序用于工业用途。我们已经增加了操作栏,文字等的大小,以帮助提高知名度和触摸目标大小。一切运作良好,但我一直无法提高操作栏溢出菜单的列表项的高度:

We are working on an Android application for industrial uses. We have increased the size of the action bar, text, etc to help improve visibility and touch target size. Everything works well, however I have been unable to increase the height of the action bar overflow menu's list items:

周围挖我已经能够使用修改弹出菜单的背景颜色

Digging around I have been able to change the background colour of the popup menu using

    <style name="MyTheme" parent="@android:style/Theme.Holo">
        <item name="android:popupMenuStyle">@style/MyPopupMenu</item>
    </style>

    <style name="MyPopupMenu" parent="android:style/Widget.Holo.ListPopupWindow">
        <item name="android:popupBackground">#800</item>
    </style>

不过似乎有没有办法,我能找到改变菜单项本身的高度。有很多的堆栈溢出的帖子谈论的操作栏自定义纺纱,但甚少行动溢出菜单。

However there seems to be no way I can find to change the height of the menu items themselves. There are a lot of posts on stack overflow talking about customising spinners in the action bar, but very little about the action overflow menu.

推荐答案

其实我只是发现了它,当工作在别的东西。在应用主题列表preferredItemHeightSmall项目:在溢出操作菜单中的项目的高度由机器人控制的。所以:

I actually just uncovered it while working on something else. The height of the items in the overflow action menu is controlled by the android:listPreferredItemHeightSmall item in the application theme. So:

<style name="MyTheme" parent="@android:style/Theme.Holo">
    <item name="android:listPreferredItemHeightSmall">72dp</item>
</style>

为我们提供了:

Gives us:

更改机器人:列表preferredItemHeightSmall将可能对其他一些事情的影响,但因为在我的情况下,我们很高兴能拥有一切大的,效果很好

Changing android:listPreferredItemHeightSmall will possibly impact on some other things, but since in my case we are happy to have everything large, it works well.

阅读全文

相关推荐

最新文章