0
에서 자원 ID를 가져옵니다 : 활동에서XML로 드로어 블
<ImageButton
android:id="@+id/b_checkEv"
android:src="@drawable/img_huella"
... />
:
ImageButton ib = (ImageButton) findViewById(R.id.b_checkEv);
Drawable dr = ib.getDrawble();
내가 ib.setDrawable와 코드 dinamically하여 ImageButton의 이미지를 변경(). 아무 때 나 ImageButton에 매 순간 어떤 이미지가 설정되어 있는지 알기 위해 Drawable에서 resouce id를 얻을 수있는 방법을 알고 있습니까?
감사합니다.
이 값을 보유하는 int를 유지할 수 있습니다. 전의. int currentImage = R.drawable.image; ib.setDrawable (currentImage); – dymmeh
감사합니다. – user23