安卓:默认AppTheme背景颜色颜色、背景、AppTheme

2023-09-06 03:06:50 作者:你还是爱她

什么是Android的AppTheme风格的默认背景颜色作为活动?

What are the default background colors for Activities in Android's AppTheme style?

我在寻找的十六进制code,或东西,我可以参考一下。它应该是一个用于光主题,一个用于DARK主题

I'm looking for the hex code, or something that I can reference. It should be one for the LIGHT theme and one for the DARK theme.

或者我在哪里可以看出来吗?我被所有的文件很乱,找不到在哪里,他们居然说色彩的地方。

Or where can I look them up? I'm confused by all the files and can't find the place where they actually say the color.

感谢您的帮助。

更新:

我发现在SDK条目 /data/values​​/colors.xml ,这是由

I found entries in the SDK in /data/values/colors.xml, which are referenced by

@android:color/background_holo_light
@android:color/background_holo_dark

但我不能把他们当成自己的看法背景色:这是给一个错误,说值是不公开的。有没有解决办法?

But I cannot put them as background color of my Views: it is giving an error saying the values are not public. Is there a workaround?

推荐答案

看看这个colors.xml文件。如果你做一个按Ctrl-F为backround_holo_dark你可以找到十六进制code。所有其他全息主题颜色是有作为。尽情享受吧!

Check out this colors.xml file. If you do a Ctrl-F for "backround_holo_dark" you can find the hex code. All the other holo theme colors are there as well. Enjoy!

    <drawable name="screen_background_holo_light">#fff3f3f3</drawable>
    <drawable name="screen_background_holo_dark">#ff000000</drawable>
    <color name="background_holo_dark">#ff000000</color>
    <color name="background_holo_light">#fff3f3f3</color>