设置RadioButton的drawableTop大小

来源:互联网 发布:北京赛车推算软件 编辑:程序博客网 时间:2024/06/05 05:28
    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);  //把这张图片放在上边,这四个参表示图片放在左、上、有、下    }
0 0
原创粉丝点击