Circular gradient in android

Posted by sandis on Stack Overflow See other posts from Stack Overflow or by sandis
Published on 2010-03-18T13:24:18Z Indexed on 2010/03/18 13:31 UTC
Read the original article Hit count: 241

Filed under:
|

Im trying to make a gradient that emits from the middle of the screen in white, and turns to black as it moves toward the edges of the screen.

As I make a "normal" gradient like this, I have been experimenting with different shapes:

<shape xmlns:android="http://schemas.android.com/apk/res/android"
    android:shape="rectangle">
    <gradient android:startColor="#E9E9E9" android:endColor="#D4D4D4"
        android:angle="270"/>
</shape>

When using the "oval"-shape I at least got a round shape, but there were no gradient effect. How can I achieve this?

Cheers,

© Stack Overflow or respective owner

Related posts about android

Related posts about gradient