【发布时间】:2021-04-18 22:40:32
【问题描述】:
如果您创建一个新的 xml 文件,其背景颜色会自动变为黑色。如何禁用它以使其始终为白色?enter image description here
【问题讨论】:
标签: android xml android-layout colors background
如果您创建一个新的 xml 文件,其背景颜色会自动变为黑色。如何禁用它以使其始终为白色?enter image description here
【问题讨论】:
标签: android xml android-layout colors background
活动的背景会自动设置在其主题中。转到样式文件夹中的样式文件,并在您的默认应用程序样式中添加一个新项目。即
<style name="myAppTheme" parent="Theme.AppCompat.Light.NoActionBar">
<item name="android:colorBackground">@color/white</item>
</style>
白色成为应用中 xml 布局的默认背景色
【讨论】: