private void setSize(RadioButton rb){
Rect rect=new Rect();
rect.set(0,0,60,60); //距离父窗体的距离,可以理解为左上和右下的坐标
Drawable[] drawables = rb.getCompoundDrawables();
drawables[1].setBounds(rect); //取出上边的图片设置大小
rb.setCompoundDrawables(null, drawables[1], null, null); //把这张图片放在上边,这四个参表示图片放在左、上、有、下
}
设置RadioButton的drawableTop大小
最新推荐文章于 2024-05-09 21:26:15 发布