Unknown On 2014년 6월 30일 월요일



<xml>
<ImageButton android:id="@+id/imagebtn"
                      android:layout_width="wrap_content"
                      android:layout_height="wrap_content"
                      android:background="@drawable/cloud"
                      android:text="this text is invisible"/>
 
 



xml 에서 android:Background = "drawable/이미지이름" 넣고 화면을 확인하면 이미지버튼으로 바뀐다.

이사진 을 보면 왼쪽이미지 오른쪽이미지 아래 주문하기 이미지가 모두 Button으로 주고 background를 설정하여 이미지 버튼으로 바꾼것이다.

그리고 이 화면은 버튼에 이미지를 적용시키려는 이미지를 넣는 경로이다.
res->xhdpi 폴더안에 이미지를 넣으면된다.
그리고 이미지를 넣기전에 이미지파일명은 소문자+언더바(_) 사용하는것이 좋고
확장자는 .png로 저장해야한다.



Leave a Reply

Subscribe to Posts | Subscribe to Comments

Powered by Blogger.