【问题标题】:Default background color of Theme.AppCompat.Light androidTheme.AppCompat.Light android的默认背景颜色
【发布时间】:2016-06-30 16:02:27
【问题描述】:

如果windowBackground设置为null,父主题Theme.AppCompat.Light,Android系统使用什么颜色代码(十六进制)

<item name="android:windowBackground">@null</item>

谁能帮我知道确切的十六进制代码?

【问题讨论】:

    标签: android android-appcompat android-theme


    【解决方案1】:

    它使用

    <color name="material_grey_50">#fffafafa</color>
    

    如主题 Platform.AppCompat.Light 中所述。此值适用于 appcompat-v7:23.4.0,可能在其他版本上有所不同。

    【讨论】:

      【解决方案2】:

      如果您将android:windowBackground 设置为null,那么您将不会从父主题中获得默认颜色。您实际上将其覆盖为空,这意味着不会将任何内容绘制为您的窗口背景。如果您的布局没有用自己的背景完全覆盖窗口,那么您将看到随机伪影。

      换句话说Avoid Null Window Backgrounds

      【讨论】:

        【解决方案3】:

        @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?

        【讨论】:

          猜你喜欢
          • 2013-11-19
          • 1970-01-01
          • 2011-10-09
          • 1970-01-01
          • 1970-01-01
          • 2013-06-26
          • 1970-01-01
          • 2021-11-24
          • 1970-01-01
          相关资源
          最近更新 更多