Reputation: 13785
I have try below xml code but I do not get output as in image.
<item >
<shape>
<gradient
android:startColor= "#AE845c"
android:endColor="#935Fc0"
/>
</shape>
</item>
I want like this .
Upvotes: 1
Views: 320
Reputation: 1856
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<stroke android:width="2dp" android:color="#FFFFFFFF" />
<gradient android:startColor="#FFFFFFFF" android:endColor="#FFFFFFFF"
android:angle="225"/>
<corners android:bottomRightRadius="5dp" android:bottomLeftRadius="5dp"
android:topLeftRadius="5dp" android:topRightRadius="5dp"/>
</shape>
you can try this...
Upvotes: 0
Reputation: 18499
try to add angle
<item >
<shape>
<gradient
android:angle="90"
android:startColor= "#bc9b78"
android:endColor="#7c4727"
/>
</shape>
</item>
if it's not working please put code where you are using this.
Upvotes: 2
Reputation: 56925
Use android type and angle for gradient. Change angle value from 0 to 360 as per your requirement.
android:type="linear"
android:angle="0"
Upvotes: 2