开发者

Cant get gradient backgrounds to look good?

I've tried everything, and se开发者_运维知识库arched the whole web, but still, nothing works.

Here is the background my designer designed:

Cant get gradient backgrounds to look good?

And here how it looks on my screen (Galaxy S I9000):

Cant get gradient backgrounds to look good?

I've tried to enable dithering with this code:

findViewById(R.id.LinearLayout_Main).getBackground().setDither(true);
    @Override
public void onAttachedToWindow() {
    super.onAttachedToWindow();
    Window window = getWindow();
    window.setFormat(PixelFormat.RGBA_8888);
}

Can anyone tell me why?


I think, this article will be interesting for you:

Android perfect UI: fighting with dithering

And you can read about dithering background here on SO too

android:dither="true" does not dither, what's wrong?

And last suggestion comes from Android Google Groups

https://groups.google.com/group/android-developers/browse_thread/thread/aebef48635d04334/2e3d86e62e0452e5?lnk=gst&q=dithering#2e3d86e62e0452e5

to use gradient proxy drawable shape instead of @drawable/image like this:

<?xml version="1.0" encoding="utf-8"?> 
<shape 
    xmlns:android="http://schemas.android.com/apk/res/android" 
    android:src="@drawable/image" 
    android:dither="true" /> 
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜