Programmatically change drawableLeft of Button
问题 I'm using a Button <Button android:id="@+id/zoom" android:layout_width="wrap_content" android:layout_height="wrap_content" android:background="@color/trans" android:drawableLeft="@drawable/left_img" android:fontFamily="arial" android:text="My Name is " android:textSize="50sp" /> and changing its text color with : zoom.setTextColor(Color.parseColor("voilet")); but not able to understand how to change its image?? 回答1: Try this: int imgResource = R.drawable.left_img; button