" />

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:

  1. Rounded TextView in Android
  2. Remove Shadow from ListView in Android
  3. Create Map From Scratch Using Mapnik
  4. Web Developer Resources #1 – CSS Layout

Tags: android

Sharing is caring

Stumble
gipoco.com is neither affiliated with the authors of this page nor responsible for its contents. This is a safe-cache copy of the original web site.