Xamarin – Tiled Background for Layout in Android

In this post we would see, how to make a layout tiled background in Android.


First of all add your tile image to the Drawable folder under Resources.



Then we need to add an XML file to the Drawable folder.


Verify that, both the files are in the same folder.


In the XML file, add the Bitmap tag and set the relevant properties such as android:src, android:tileMode, and android:dither.


Next thing is, we would refer this XML file to the android:background attribute of the Layout control.


Now, let’s run the application and you would see the tiled image as background.


Hope this quick post helps you, thanks for reading.


Full Source Code: Click Here