动态修改checkbox样式

动态修改checkbox选中样式

1.在布局文件中使用:

<android.support.v7.widget.AppCompatCheckBox
	android:id="@+id/regist_cb"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:checked="true" />

2.在代码中动态修改:

ColorStateList colorStateList = ColorStateList.valueOf(Color.parseColor( Constants.APPInfo.APP_MIAN_COLOR));
registCheckBox.setSupportButtonTintList(colorStateList);

猜你喜欢

转载自blog.csdn.net/androidWorkor/article/details/88894774