I have this drawable resource:
<?xml version="1.0" encoding="utf-8"?>
<bitmap xmlns:android="http://schemas.android.com/apk/res/android"
android:src="@drawable/bg_stripe"
android:tileMode="repeat"
android:antialias="true"
android:dither="false"
android:filter="false"
android:gravity="left"
/>
used as background here:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/bg_world_locked" >
Sometimes everything works well, sometimes not (the drawable resource appears in its real small size and not repeated). Why? It's an Android bug? I run this on my HTC Desire Android 2.3.
Unfortunately yes - it's Android bug. Check this answer
Tiled drawable sometimes stretches
In short: you should set repeating in Java code instead of XML.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With