How to Make Tiled Background in Android
October 6th, 2011
Assuming you have tile pattern name type.png, you need to create xml in drawable directory.
background.xml
1 2 3 4 5 6 7 | <?xml version="1.0" encoding="utf-8"?> <bitmap xmlns:android="schemas.android.com/apk/res/android" android:src="@drawable/type" android:tileMode="repeat" android:dither="true" /> |
In your layout, set the value of background to your xml background.
1 2 3 4 5 6 7 8 9 | <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent" android:background="@drawable/background" > ... </LinearLayout> |
Related posts:
- Rounded TextView in Android
- Remove Shadow from ListView in Android
- Create Map From Scratch Using Mapnik
- Web Developer Resources #1 – CSS Layout
Tags: android
Sharing is caring