기술참고자료/Android
View에 백그라운드 반복설정
농사꾼봉팔
2011. 4. 20. 10:56
안드로이드에서 아래와 같이 EditText 에 편지지와 같은 배경을 적용하려면 다음과 같이 하면 된다.
drawable 에 xml 파일을 만들고 속성에 repeat 를 준 다음에 EditText 에서 resource를 호출하여 사용하면 된다.
drawable/letter_background.xml
출처 : http://blog.inculab.net/42
drawable/letter_background.xml
<?xml version="1.0" encoding="utf-8"?>
<bitmap xmlns:android="http://schemas.android.com/apk/res/android"
android:src="@drawable/dot_line"
android:tileMode="repeat"
/>
<EditText
android:id="@+id/edit_content"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_below="@id/edit_title"
android:background="@drawable/letter_background"
android:gravity="top"
android:lineSpacingExtra="20px"
android:minHeight ="200px"
/>

출처 : http://blog.inculab.net/42