I’m trying to add a background texture and a border to a button. But i’m not able to se both the things on my button.
with this i have my background image
<item>
<bitmap android:src="@drawable/button_background" android:tileMode="repeat" />
</item>
and with this i sould have a border
<corners android:radius="5dp" />
<stroke android:width="3px" android:color="#FFFFFF" />
i tried to combine them using both <shape> and <layer-list> but i can get either the border or the background texture.
9patches are generally very good for this situation (make sure to use the draw9patch tool in the tools directory of your SDK), but if you don’t want to create your own graphics (bear in mind you’ll need to make several versions for each resolution) and want to use XML, you can do something like this:
Source: http://www.dibbus.com/2011/02/gradient-buttons-for-android/