如何更改选项菜单按钮的大小?

发布于 2024-10-04 12:35:32 字数 165 浏览 1 评论 0原文

我有一个带有 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

¢好甜 2024-10-11 12:35:32

据我所知,菜单使用最多三个彼此相邻的按钮的标准布局,如果您阅读此内容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.

勿忘初心 2024-10-11 12:35:32

我不是百分百确定你的意思?但是你也许能够通过边距和填充来实现你想要的效果?

填充会增加按钮的大小

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文