有什么方法可以在 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
的属性,我可以使用它来实现真实设备中的更改。
原文由 Nadeesha Thilakarathne 发布,翻译遵循 CC BY-SA 4.0 许可协议
将
colorAccent
设置为您想要的颜色:或者,如果您不想更改主主题,请创建一个新主题并将其仅应用于复选框: