如何从 activity android 中删除全局背景色
How to remove global background color from a activity android
我在主题中添加了整个项目的背景颜色。
<item name="android:background">@color/primary_background</item>
<item name="background">@color/primary_background</item>
现在的问题是每当我尝试使用 bottomnavigation bar 或任何其他像我正在使用的设计库时 for the tour。在 bottomnavigationview 的情况下,如果我设置了全局背景,那么我将无法更改底部栏的背景颜色。在旅游案例中,背景设置为全局背景色。
有什么方法可以取消 activity 的全局背景颜色设置。
就我而言,我创建了另一个通用主题:without_background_color_theme 并将除背景颜色之外的所有属性都移至该主题。然后你的背景颜色主题将扩展 without_background_color_theme。现在您可以将要取消设置背景颜色的 Activity 的主题设置为 without_background_color_theme。
<style name="background_color_theme" parent="without_background_color_theme>
<item name="android:windowBackground">@color/custom_theme_color</item>
<item name="android:colorBackground">@color/custom_theme_color</item>
</style>
我在主题中添加了整个项目的背景颜色。
<item name="android:background">@color/primary_background</item>
<item name="background">@color/primary_background</item>
现在的问题是每当我尝试使用 bottomnavigation bar 或任何其他像我正在使用的设计库时 for the tour。在 bottomnavigationview 的情况下,如果我设置了全局背景,那么我将无法更改底部栏的背景颜色。在旅游案例中,背景设置为全局背景色。
有什么方法可以取消 activity 的全局背景颜色设置。
就我而言,我创建了另一个通用主题:without_background_color_theme 并将除背景颜色之外的所有属性都移至该主题。然后你的背景颜色主题将扩展 without_background_color_theme。现在您可以将要取消设置背景颜色的 Activity 的主题设置为 without_background_color_theme。
<style name="background_color_theme" parent="without_background_color_theme>
<item name="android:windowBackground">@color/custom_theme_color</item>
<item name="android:colorBackground">@color/custom_theme_color</item>
</style>