How can I do this?
This is what I use to change text color:
maleRadioButton.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
if (isChecked) {
maleRadioButton.setTextColor(getApplicationContext().getResources().getColor(R.color.colorPrimary));
} else {
maleRadioButton.setTextColor(getApplicationContext().getResources().getColor(R.color.lightGray));
}
}
});
and I set <item name="android:buttonTint">@color/colorAccent</item>
, but the unselected radio button is colorAccent
instead of lightGray
Any ideas?
Aucun commentaire:
Enregistrer un commentaire