【问题标题】:Why doesn't android:colorBackground work on some devices?为什么 android:colorBackground 在某些设备上不起作用?
【发布时间】:2021-12-22 22:29:41
【问题描述】:
<resources>
    <style name="Theme.MyApplication" parent="Theme.MaterialComponents.Light">
        <item name="android:colorBackground">#26A69A</item>
    </style>
</resources>

我想知道为什么android:colorBackground 在某些设备上不起作用。我在 API 21 (Not working)24 (Not Working)29 (Working) 上运行应用程序。

【问题讨论】:

    标签: android material-design material-components-android material-components


    【解决方案1】:

    我这样改后现在可以工作了

    <resources>
        <style name="Theme.MyApplication" parent="Theme.MaterialComponents.Light">
            <item name="android:colorBackground">@color/myColor</item>
        </style>
    </resources>
    

    【讨论】:

      猜你喜欢
      • 2016-01-25
      • 1970-01-01
      • 2016-03-31
      • 2016-09-14
      • 2015-05-17
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多