如何更改 Android 2.3 的选项菜单背景? [英] How can I change the Options menu background for Android 2.3?

查看:31
本文介绍了如何更改 Android 2.3 的选项菜单背景?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有相同的标准选项菜单,但我想将项目的背景从白色更改为黑色.我看过很多关于如何做到这一点的帖子,但这些帖子不适用于 2.3.

I have the same standard options menu, but I want to change the background of the items from white to black. I've seen many postings about how to do it, but those don't work for 2.3.

有谁知道具有与 2.3 版兼容的自定义颜色背景的工作菜单充气器吗?

Does anyone know of a working menu inflater with a custom-colored background compatible with version 2.3?

**注意**没有图像放置!!!没有来自其他帖子的代码,因为我在这里都试过了!!!

**ATTENTION** NO IMAGE PLACEMENT!!! NO CODE FROM OTHER POSTINGS, BECAUSE IVE TRIED THEM ALL HERE!!!

推荐答案

在理想情况下,您不应该这样做.根据他们的决定,不同的设备会有不同的颜色.如果您真的必须自定义菜单项的背景,那么我建议不要使用它.相反,创建某种上下文菜单,您可以根据需要对其进行完全自定义.

In an ideal scenario, you shouldn't be doing that. Various devices would have different colors, as they decide. If you really really have to customize the menu item's backgrounds, then, I would suggest don't use it. Instead, create some kind of context menu, which you can fully customize as per your needs.

我知道这可能不是您要求的解决方案,但无论您为此采取什么解决方法,它都可能适用于一些设备,而对其他人来说可能是一场灾难.

I know its probably not a solution you are asking for, but whatever workarounds you will be be doing for this, it might work for a few device, and would probably be a disaster for others.

这篇关于如何更改 Android 2.3 的选项菜单背景?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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