I have a pattern (.png image 4x4px) and have to fill the layout with it.
Does anyone know how to do this?
If I simply select the drawable as a background the image, it is stretched; instead it needs to be repeated along the x and y axis.
I have a pattern (.png image 4x4px) and have to fill the layout with it.
Does anyone know how to do this?
If I simply select the drawable as a background the image, it is stretched; instead it needs to be repeated along the x and y axis.
Here is a really nice explanation:
Put your "back.png" image on "drawable" folder. Then create a drawable "backrepeat.xml" like that:
In your layout, add
android:background="@drawable/backrepeat"
:As is the case with many Android good practices/handy tricks, it can be traced back to Romain Guy.