Issue
I set an image to a RadioButton's drawableLeft, but it's to big. I want to set the image's height, width and scaleType in order to let it looks ok, just like in an ImageView:
android:layout_width="30dip"
android:layout_height="30dip"
android:scaleType="fitXY"
But i find there are no attributions for image when it's set in drawableLeft.
Is there any ways to solve this.
Is it possible to handle this in XML ?
Solution
I think this should work:
Drawable drawable = context.getResources().getDrawable(id);
drawable.setBounds(0, 0, 30, 30);
radioButton.setCompoundDrawables(drawable, null, null, null);
Answered By - Chintan Soni
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.