In my XML contains one CheckBox. How to change check box border color via programmatically in android.
My Sample ScreenShot is here
ScreenShot
Thanks.
In my XML contains one CheckBox. How to change check box border color via programmatically in android.
My Sample ScreenShot is here
ScreenShot
Thanks.
you can set
check.setButtonDrawable(mContext.getResources().getDrawable(
R.drawable.radio));
in radio.xml you can set any background to your check box.
in radio.xml
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/option_unselected" android:state_checked="false"/>
<item android:drawable="@drawable/option_selected" android:state_checked="true"/>
</selector>
here option_selected and option_selected are the graphics for selected and unslected state.
for more you can check http://developer.android.com/guide/topics/resources/drawable-resource.html#StateList