如何更改选项菜单按钮的大小?
我有一个带有 5 个按钮的选项菜单(当您按下手机的菜单键时会弹出),所有按钮都带有一张 48x48 的图像和文本。
现在,五个按钮显示在两行中,但我想减小它们的大小以将所有五个按钮放入一行。
我怎样才能实现这个目标?
我可以使用菜单布局 XML 文件中的参数来实现吗?
I have an options menu (it pops up when you press the menu key of the phone) with 5 buttons, all of them with one 48x48 image and text.
Now the five buttons are displayed in two rows, but I want to reduce the size of them to fit all five buttons into one row.
How can I achieve this?
Can I do it with parameters in the menu's layout XML file?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
据我所知,菜单使用最多三个彼此相邻的按钮的标准布局,如果您阅读此内容http://developer.android.com/guide/topics/ui/menus.html 它说您可以在普通菜单中添加最多 6 个菜单项,然后它们将移至扩展菜单,因此每行 3 个项目,两行总共 6 个项目。 Android 就是这样设计的。
As far as I know the menu is using a standard layout of max three buttons next to each other, to make it tough friendly if you read this http://developer.android.com/guide/topics/ui/menus.html it says you can add max 6 menu items in the normal menu after that they will move into the extended menu, so 3 items per line total of 6 items on two lines. It's just how Android is designed.
我不是百分百确定你的意思?但是你也许能够通过边距和填充来实现你想要的效果?
填充会增加按钮的大小
I'm not 100 percent sure what you mean? But you might be able to achieve what you want with margin and padding?
Padding would increase the size of your button