原始
修改后
关键代码
RadioButton[] radioButtons = new RadioButton[]{rb1, rb2, rb3, rb4};
for (RadioButton rb : radioButtons) {
Drawable[] drawables = rb.getCompoundDrawables();
Rect r = new Rect(0, 0, dpToPx(this, 10),dpToPx(this, 10));
drawables[1].setBounds(r);
rb.setCompoundDrawables(null, drawables[1], null, null);
}
需要改变大小,改变后边两个参数即可。除了具体数值,也可以用比例drawables[1].getMinimumWidth()*1/2