Page 1 of 1

Layout Background texture in android

Posted: Fri Nov 21, 2014 5:57 pm
by vivekkalady
Pick something from Subtle Patterns, e.g. irongrip.png and drop it in your drawable-hdpi folder

Make a BitmapDrawable, e.g. irongrip_repeating.xml

Code: Select all

<?xml version="1.0" encoding="utf-8"?>
<bitmap xmlns:android="http://schemas.android.com/apk/res/android"
    android:src="@drawable/irongrip"
    android:tileMode="repeat" />


Apply it to a View

Code: Select all

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
   android:layout_width="fill_parent"
   android:layout_height="fill_parent"
   android:background="@drawable/irongrip_repeating"
   android:orientation="vertical">
</LinearLayout>