布局文件默认背景色为黑色

问题描述 投票:0回答:1

每当我在 android studio 项目中创建新的布局文件时,它的默认背景颜色始终为黑色,我必须使用

    android:background="#FFF"
将其颜色更改为白色。但这在设计时带来了很多挑战。

有人解决了吗?

这是xml文件的代码。

<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=".ui.management.EnrollDevice.Fragments.FragmentFour"

    >




</androidx.constraintlayout.widget.ConstraintLayout>

布局文件的图像

android android-studio user-interface
1个回答
0
投票

检查

System UI Mode
是否设置为
Not Night

screenshot

© www.soinside.com 2019 - 2024. All rights reserved.