【发布时间】:2021-04-17 16:09:11
【问题描述】:
有没有办法在 android XML 中将复选框(勾选框)颜色更改为白色。 (我需要包含黑色勾号的白色勾选框,作为我在真实设备中的 android studio 中获得的预览)
这是我的复选框代码
<CheckBox
android:textSize="15sp"
android:textColor="#fff"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Save Loging "
android:id="@+id/checkBox"
android:layout_below="@id/PasswordeditText"
android:checked="true"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:buttonTint="#fff" />
当我添加 android:buttonTint="#fff" 预览时显示我需要的更改,但它在真实设备中不起作用
设计预览
真实设备
有没有像android:buttonTint 这样的属性可以用来实现真实设备的更改。
【问题讨论】:
-
看这里,可能有帮助:stackoverflow.com/a/12889958/3332634
-
@yshahak 我检查了它,但它对我不起作用