图片设置为多个重复(不不拉伸)

/**
	 * 图片设置为多个重复(不不拉伸)
	 * 
	 * @return Drawable
	 */
	public static Drawable setViewBackground(Context context,
			int backgroundImage) {
		Bitmap bitmap = BitmapFactory.decodeResource(context.getResources(),
				backgroundImage);
		BitmapDrawable bd = new BitmapDrawable(bitmap);
		bd.setTileModeXY(TileMode.REPEAT, TileMode.REPEAT);
		bd.setDither(true);

		return bd;
	}
 

猜你喜欢

转载自ipc.iteye.com/blog/1688387