
Untitled
By: a guest on
May 30th, 2012 | syntax:
None | size: 0.60 KB | hits: 17 | expires: Never
How to add a PNG image as background in Android with no alteration (banding)?
android:background="@drawable/background_gradient_dithered"
<?xml version="1.0" encoding="utf-8"?>
<bitmap xmlns:android="http://schemas.android.com/apk/res/android"
android:src="@drawable/background_gradient" android:dither="true" android:antialias="true" android:filter="true"/>
getWindow().setFormat(PixelFormat.RGBA_8888);
Window window = getWindow();
window.setFormat(PixelFormat.RGBA_8888);
window.addFlags(WindowManager.LayoutParams.FLAG_DITHER);
window.addFlags(WindowManager.LayoutParams.FLAG_DITHER);