How to apply an undistorted texture?

1

I have a texture like this, which I will apply in many different shapes and sizes, in addition to table background and table rows.

How do you apply it in multiple sizes without distorting? Is it possible?

NOTE: I used ninepatch but because it was a texture, it ended up distorting the image.

    
asked by anonymous 09.02.2014 / 03:19

1 answer

4

Go to your drawable XML and add the tileMode="repeat" property. For example:

drawable/imagem_de_fundo.xml :

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

Then use @drawable/imagem_de_fundo as your image, it will scale by repeating rather than being zoomed in.

    
09.02.2014 / 03:38