【发布时间】:2021-10-04 03:41:18
【问题描述】:
我正在尝试为我的 Android 应用设置背景。
但是用android:background 属性设置它不起作用:
<GridLayout ...
android:background="#ffffff00">
我什至在父元素上设置了背景:
<androidx.coordinatorlayout.widget.CoordinatorLayout 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"
android:background="#ffffff00">
但它仍然显示我只是黑暗的背景。
我在我的手机(如果重要的话是小米)上开启了黑暗模式。当我关闭此模式时,背景会按预期工作。
所以我想知道如何在应用中覆盖暗模式?
看起来这个暗模式已经覆盖了这个属性,这是不可能的。
【问题讨论】:
标签: c# android xamarin xamarin.android