L. *_*ter 11 android android-drawable android-radiobutton
我将图像设置为RadioButton的drawableLeft,但它很大.我想设置图像的高度,宽度和scaleType,以使它看起来不错,就像在ImageView中一样:
android:layout_width="30dip"
android:layout_height="30dip"
android:scaleType="fitXY"
Run Code Online (Sandbox Code Playgroud)
但我发现当它在drawableLeft中设置时,没有图像属性.
有没有办法解决这个问题.
是否有可能在XML中处理这个问题?
我认为这应该有效:
Drawable drawable = context.getResources().getDrawable(id);
drawable.setBounds(0, 0, 30, 30);
radioButton.setCompoundDrawables(drawable, null, null, null);
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
1368 次 |
| 最近记录: |