简体   繁体   中英

Banding on ICS Holo Theme

I'm seeing banding on my activities using the Holo theme on my Samsung Galaxy Nexus, Android version 4.0.2.

Below is a screenshot of my PreferenceActivity, taken from the Nexus using DDMS, which illustrates the issue.

I have tried adding (to no avail):

getWindow().setFormat(PixelFormat.RGBA_8888);
getWindow().addFlags(WindowManager.LayoutParams.FLAG_DITHER);

What causes this and is there a work around?

偏好活动

This worked for me:

@Override
    public void onAttachedToWindow() {

            getWindow().setFormat(PixelFormat.RGBA_8888);
}

Dither itself is an imperfect solution to the problem, check to see that:

  1. Make sure the Bitmap is loaded with the following settings BitmapFactory.Options.inPreferredConfig=Bitmap.Config.RGBA_8888 and BitmapFactory.Options.inDither=false

  2. The background image is not stretched

Reference

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM