我有两种 PNG 变体,一种是绘制的文本是黑色的,另一种是白色的。默认情况下,在白色背景上,我使用黑色图像变体,但是当启用系统暗模式时,图像在背景中变得几乎不可见。
启用暗模式后,如何指示我的应用使用备用图像?
图像在活动的 XML 中设置:
<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="com.me.some_app.someActivity">
<ImageView
android:id="@+id/Logo"
android:layout_width="176dp"
android:layout_height="219dp"
android:contentDescription="@string/LogoDescription"
app:layout_constraintBottom_toTopOf="@+id/divider"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:srcCompat="@drawable/logo_black" />