【发布时间】:2016-06-30 16:02:27
【问题描述】:
如果windowBackground设置为null,父主题Theme.AppCompat.Light,Android系统使用什么颜色代码(十六进制)
<item name="android:windowBackground">@null</item>
谁能帮我知道确切的十六进制代码?
【问题讨论】:
标签: android android-appcompat android-theme
如果windowBackground设置为null,父主题Theme.AppCompat.Light,Android系统使用什么颜色代码(十六进制)
<item name="android:windowBackground">@null</item>
谁能帮我知道确切的十六进制代码?
【问题讨论】:
标签: android android-appcompat android-theme
它使用
<color name="material_grey_50">#fffafafa</color>
如主题 Platform.AppCompat.Light 中所述。此值适用于 appcompat-v7:23.4.0,可能在其他版本上有所不同。
【讨论】:
如果您将android:windowBackground 设置为null,那么您将不会从父主题中获得默认颜色。您实际上将其覆盖为空,这意味着不会将任何内容绘制为您的窗口背景。如果您的布局没有用自己的背景完全覆盖窗口,那么您将看到随机伪影。
【讨论】:
@null 表示完全没有背景(View.getBackground() 返回 null)。
这意味着您要删除背景。
这些是相关的QA:
is there any diff @null Vs #00000000
Set Background as null
How to have a transparent ImageButton: Android
How can I specify a null as an XML attribute for Android?
【讨论】: