【发布时间】:2017-11-25 02:08:44
【问题描述】:
我想更改复选框边框颜色的颜色,但我需要以编程方式进行。
这是我的代码
if (Build.VERSION.SDK_INT < 21) {
//The issue is here
CompoundButtonCompat.setButtonTintList(holder.checkbox, ColorStateList.valueOf(this.currentThemeOptions.modalFormsTextColor));
} else {
//This works just fine
holder.checkbox.setButtonTintList(ColorStateList.valueOf(this.currentThemeOptions.modalFormsTextColor));
}
您对在 低于 API 21 的 Android API 中更改复选框的边框颜色有何建议?
【问题讨论】:
-
@SahilManchanda 我需要以编程方式完成此操作。
-
使您的 chechbox 支持复选框 android.support.v7.widget.AppCompatCheckBox
-
谢谢@Bek。它适用于 API
-
@Emre rica ederim
标签: android checkbox android-checkbox