我在background attribute
中应用了一个Android android button
。在day/light
模式下,该属性可以完美地应用而没有问题,但是在切换到night/dark mode
时,该属性不被应用,并且带有grey background
的按钮而不是{{1} }。
这是我的android按钮代码:
theme applied
这是我为背景绘制的代码:
<Button
android:id="@+id/logoutbtn"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/view2"
android:layout_centerHorizontal="true"
android:text="@string/logout_text"
android:textSize="14sp"
android:typeface="normal"
android:layout_marginTop="5dp"
android:layout_marginStart="50dp"
android:layout_marginEnd="50dp"
android:layout_marginBottom="20dp"
android:background="@drawable/button_background_accent_rounded"
/>
我得到的输出是:
高度赞赏在不更改Java代码的情况下提供的任何帮助或建议。