Theme.AppCompat.Light android的默认背景颜色

时间:2016-06-30 16:02:27

标签: android android-appcompat android-theme

如果对于父主题 Theme.AppCompat.Light

,windowBackground设置为null,那么Android系统使用的颜色代码(十六进制)是什么?
<item name="android:windowBackground">@null</item>

任何人都可以帮我了解确切的六进制代码吗?

3 个答案:

答案 0 :(得分:7)

使用

<TextView xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/mainListItem"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:textColor="#ff0000"
    android:textSize="20sp"
    >

</TextView>

如主题<color name="material_grey_50">#fffafafa</color> 中所述。此值适用于Platform.AppCompat.Light,可能在其他版本上有所不同。

答案 1 :(得分:2)

如果您将android:windowBackground设置为null,那么您将不会从父主题获取默认颜色。你实际上将其覆盖为null,这意味着什么都不会被绘制为你的窗口背景。如果您的布局完全没有用自己的背景覆盖窗口,那么您将会看到随机的文物。

换句话说Avoid Null Window Backgrounds

答案 2 :(得分:1)

@null表示根本没有背景(View.getBackground()返回null) 这意味着您要删除背景。

这些是相关的质量保证:
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?

相关问题