I know how to make a background pattern repeating a bitmap. I also saw a way to combine two bitmaps using Canvas. But I want to make a repeating bitmap in combination with a gradient drawable to make a background. I have a .png file that it's partially transparent and I want to repeat it along with a gradient drawable (normal gradient XML).
This is the PNG: http://subtlepatterns.com/?p=1203
Is there a way to do this?
Thanks in advance.
You can use an XML bitmap to create a tile pattern:
<bitmap xmlns:android="http://schemas.android.com/apk/res/android"
android:src="@drawable/my_png"
android:tileMode="repeat" />
Then you should be able to use this as part of a LayerList drawable that also includes your gradient. Then use the layer list as the background drawable.
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