open coding
open coding. 이미지 리소스 res>drawable> image.xml 만들기
◀ ▷ ▶ ♤ ♠ ♡ ♥ ♧ ♣ ⊙e
2020. 11. 26. 16:50
반응형
drawable - > <tile.xml>
<?xml version="1.0" encoding="utf-8"?>
<bitmap xmlns:android="http://schemas.android.com/apk/res/android"
android:src="@drawable/djk1"
android:tileMode="mirror"/>
<!--bitmap원본크기 그래도 여러개 복사되서화면채움.-->
drawable - > <layer.xml>
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<bitmap android:src="@drawable/efefef" android:gravity="center"></bitmap>
</item>
<item>
<bitmap android:src="@drawable/egege" android:gravity="center"/>
</item>
<item>
<bitmap android:src="@drawable/aefe" android:gravity="center"/>
</item>
</layer-list>
<!--
이미지 겹치기. 어느정도 위치도 조정해서 설정.
android:gravity="center" 이거 추가하면 원본크기 그대로 유지된다.-->
drawable - > <button.xml>
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/efefef" android:state_pressed="true"/>
<item android:drawable="@drawable/we"/>
</selector>
<!--
눌렀을때 안눌렀을때 버튼 이미지 설정.
단, 기본상태이미지는 제일 마지막줄에 코딩해서, 잘 적용된다.(상태에따른 이미지 변화가)-->