更改操作栏溢出菜单项,通过风格的高度 [英] Change the height of the action bar overflow menu items via styles

查看:212
本文介绍了更改操作栏溢出菜单项,通过风格的高度的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们正在开发一个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.

这篇关于更改操作栏溢出菜单项,通过风格的高度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆