0

How to remove the current drawable and go to old drawable state;

RadioButton radioButton = (RadioButton) findViewById(R.id.opt1);
radioButton.setButtonDrawable(R.drawable.ic_done);

For the next question, it should go to the old drawable.

So I have tried radioButton.setButtonDrawable(0) but it removed the drawable. Is there any way to getDefaultDrawable() according to Theme.AppCompat?

4

1 回答 1

-1

你可以这样做:

改变背景之前

RadioButton radioButton;
Drawable defaultRadioButtonBackground = radioButton.getBackground();

当您想要更改回默认背景时

radioButton.setBackground(defaultRadioButtonBackground);
于 2015-03-22T16:18:24.550 回答