更新时间:2023-10-06 21:10:52
尝试此
AppCompatRadioButton newRadioButton = new AppCompatRadioButton(this);
AppCompatCheckBox newCheckBox = new AppCompatCheckBox(this);
I created RadioButton
and CheckBox
in LinearLayout
programatically. But, now I want to change radio button's color and check boxes's color. I use
RadioButton.setHighlightColor(Color.parseColor("#0c83bd"));
checkbox.setHighlightColor(Color.parseColor("#0c83bd"));
But it didn't work.
Try this
AppCompatRadioButton newRadioButton = new AppCompatRadioButton(this);
AppCompatCheckBox newCheckBox = new AppCompatCheckBox(this);
Insted of
RadioGroup newRadioButton = new RadioGroup(this);
CheckBox newCheckBox = new CheckBox(this);