can we make multi color gradient in xml for android background?


I have been trying to make a multi-color background in XML but there only 3 option available start, center, end and specified angles. Can't we make backgrounds like this below..multi color at different angle

multi color at different angle

Can we make like this background in android ??


Answers:


According to developers.android you can... and this is the code they used

<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle" >

<gradient
    android:angle="45"
    android:endColor="#87CEEB"
    android:centerColor="#768087"
    android:startColor="#000"
    android:type="linear" />

</shape>

also here's a tutorial

hope this helps