更改背景颜色会影响儿童 [英] Changing the background color affects children

查看:48
本文介绍了更改背景颜色会影响儿童的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图通过在主应用程序主题中添加一行来更改应用程序中的基本背景颜色:

I was trying to change the basic background color in my app by adding a single line to the main application theme:

<!-- Application theme. -->
<style name="AppTheme" parent="AppBaseTheme">
    <!-- All customizations that are NOT specific to a particular API-level can go here. -->
    <item name="android:background">@android:color/white</item>
</style>

不过,它级联到诸如操作栏和徽标之类的子对象上:

However it's cascading down to child objects like the actionbar and logo like this:

我在做什么错了?

推荐答案

使用 android:windowBackground 代替 background 属性:

<item name="android:windowBackground">@android:color/white</item>

这篇关于更改背景颜色会影响儿童的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆