【发布时间】:2019-04-18 15:52:31
【问题描述】:
我是 Android 开发新手,我正在关注 this 教程,以在 Android 中展示 Checkbox。 Checkbox 正确显示。
但我想更改复选框颜色。我该怎么做?
【问题讨论】:
我是 Android 开发新手,我正在关注 this 教程,以在 Android 中展示 Checkbox。 Checkbox 正确显示。
但我想更改复选框颜色。我该怎么做?
【问题讨论】:
您可以在不使用 buttonTint 更改可绘制对象的情况下执行此操作(从 API 23 开始):
<CheckBox
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:buttonTint="@color/CHECKMARK_COLOR_HERE" />
或对旧版本的 android/兼容性使用 AppCombatCheckBox。
<android.support.v7.widget.AppCompatCheckBox
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:buttonTint="@color/CHECKMARK_COLOR_HERE" />
更多答案在this链接中
【讨论】: