używam przycisku
Programowo zmienić drawableLeft Buttona
<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" />
i zmienia swój kolor tekstu z:
zoom.setTextColor(Color.parseColor("voilet"));
ale nie jest w stanie zrozumieć how to change its image??
przyjrzeć się http://developer.android.com/guide/topics/ui/controls /button.html#CustomBackground do stylu przycisku – Eluvatar
Ustaw podobny przycisk.setBackground (R.drawable.ic_launcher); wewnątrz detektora onclick. – Aravin
Możliwy duplikat [Jak programowo ustawić opcję drawableLeft na urządzeniu z Androidem?] (Http://stackoverflow.com/questions/4502605/how-to-programically-set-drawableleft-on-android-button) – Varun