I\'m facing a small problem with the LinearGradient definition in XML. What I want is to use the constructor that accepts the array of colors and the array of positions.
<
Unfortunately, the definition of GradientDrawable with XML does not allow more than three colors.
Take a look at the official reference: http://developer.android.com/reference/android/graphics/drawable/GradientDrawable.html.
Example:
So, in your case you would add one more color using android:CenterColor
.
But for more than three colors, you'll even need to do it with Java.