通过代码设置改变radiobutton图片大小

可以设置图片,也可以设置选择器。
Drawable drawableWechat = ResourcesCompat.getDrawable(getResources(), R.drawable.pay_wechat_img_selector, null);
//四个参数对应 左右边距,上下边距,宽,高
drawableWechat.setBounds(0, 0, 55, 50);
//第二个参数代表top图标
payRbWechat.setCompoundDrawables(null, drawableWechat, null, null);

猜你喜欢

转载自blog.csdn.net/qq_25409587/article/details/78215067