Is it possible to dither a gradient drawable?

Posted by Seu on Stack Overflow See other posts from Stack Overflow or by Seu
Published on 2010-05-07T19:05:45Z Indexed on 2010/05/07 19:08 UTC
Read the original article Hit count: 227

Filed under:
|
|

I'm using the following drawable:

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

    <gradient 
        android:startColor="@color/content_background_gradient_start"
        android:endColor="@color/content_background_gradient_end" 
        android:angle="270"
        />

</shape>

The problem is that I get severe banding on hdpi devices (like the Nexus One and Droid) since the gradient goes from the top of the screen to the very bottom.

According to http://idunnolol.com/android/drawables.html#shape_gradient there isn't a "dither" attribute for a gradient. Is there anything I can do to smooth the gradient?

© Stack Overflow or respective owner

Related posts about android

Related posts about android-sdk