<?xml version="1.0" encoding="UTF-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid android:color="#EAEAEA"/>
<corners android:bottomLeftRadius="5dip"
android:topRightRadius="5dip"
android:topLeftRadius="5dip"
android:bottomRightRadius="5dip"
/>
</shape>
How can i set my gradient image as background for my button. I see a property gradient, but cannot see any attributes holding background in it.
Note: I am Very new Android development.
I am not sure what the XML you showed us has to do with gradients. You can define a gradient in an XML file in your
drawablefolder:(for example, save this as
my_gradient.xml)Then in your layout xml file you can have: