我有一个带有drawableTop的按钮,有没有办法改变drawableTop图像的高度和宽度,我可以更改drawableTop的填充,但不能更改高度或宽度,任何建议都可以提前感谢。
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:drawableLeft="@drawable/inventory_Icon"
android:text="Inventory"/>
发布于 2016-03-17 04:03:27
你需要做的就像下面的一样。
Drawable drawable = context.getResources().getDrawable(id);
drawable.setBounds(0, 0, 30, 30);
yourTextView.setCompoundDrawables(drawable, null, null, null);
Done
https://stackoverflow.com/questions/36059900
复制