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:
Make sure the Bitmap is loaded with the following settings BitmapFactory.Options.inPreferredConfig=Bitmap.Config.RGBA_8888
and BitmapFactory.Options.inDither=false
The background image is not stretched
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.