Android examples for User Interface:View Background
fix View Background Repeat
//package com.java2s; import android.graphics.Shader; import android.graphics.drawable.BitmapDrawable; import android.view.View; public class Main { public static void fixBackgroundRepeat(View view) { if (view != null) { BitmapDrawable background = (BitmapDrawable) view .getBackground();// w w w. ja va 2 s . c o m if (background != null) { background.mutate(); background.setTileModeXY(Shader.TileMode.REPEAT, Shader.TileMode.REPEAT); } view.requestLayout(); } } }