I would just like to know the best way to achieve this. I have a button that has rounded corners however I would also like to have the background of the button be a texture that is tiled.
I'd appreciate any help
I would just like to know the best way to achieve this. I have a button that has rounded corners however I would also like to have the background of the button be a texture that is tiled.
I'd appreciate any help
For rounded corners check this:
http://nishantvnair.wordpress.com/2010/11/09/customize-button-in-android/
to add image background, just add this into dravable resource
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<shape android:shape="rectangle" android:padding="10dp">
<corners android:bottomRightRadius="30dp"
android:bottomLeftRadius="30dp"
android:topLeftRadius="30dp"
android:topRightRadius="30dp" />
</shape>
</item>
<item>
<bitmap android:src="@drawable/yourfilename"
android:tileMode="repeat" />
</item>
</layer-list>
thank you matej for your suggestions however they do not work :(. I ended up just doing the inevitable and created a custom view where I imported a GradientDrawable from my resources where I defined the rounded corners etc, and then I also imported my "texture" as a BitmapDrawable and used PorterDuffXfermode to mask it. It would be nice to be able to create a shape and then apply a drawable to that shape :(.