在Android的自定义选项菜单自定义、选项、菜单、Android

2023-09-12 08:07:05 作者:知是故人来

我要创造我的应用程序自定义的 OptionsMenu 。默认 OptionsMenu 显示只有三个项目在一排。现在我想显示五至六个项目仅有的图标。此外,我想改变OptionsMenu的背景颜色,但没有得到这样的适当方式。如果可能的话,那么请让我知道这件事情。

I want to create a custom OptionsMenu in my application. The default OptionsMenu display only three items in one row. Now i want to display five to six items having only icons. Also i want to change the background color of the OptionsMenu but not getting the appropriate way of doing this. If it is possible then please let me know about it.

推荐答案

简短的回答

由于它困扰我,当应用程序改变我的Andr​​oid的小部件的用户。我不会建议改变这一点,Android不提供一种方式来做到这一点。

As an user it bothers me when the application changes my android's widgets. I wouldn't recommend changing that and android doesn't provide a way to do it.

龙的答案

尽管Android不提供一种方法来定制,你可以随时处理关键事件,并表示从自己的一个观点。在计算器 类似的讨论。

Even though Android doesn't provide a way to customize that you can always handle the key event and show a view from your own. Similar discussion in stackoverflow.