Android Button drawableLeft - 如何硬编码(无xml)

Kan*_*gee 5 android button drawable

如何向按钮对象添加"可绘制的左侧"图标?

我的意思是这样的:

Button button = new Button();
button.setDrawableLeft(R.drawable...);
Run Code Online (Sandbox Code Playgroud)

Pet*_*ego 6

使用Button.setCompoundDrawablesWithIntrinsicBounds(..)android:drawableLeft属性有关.