Android activity 平铺背景图片

Bitmap bitmap = BitmapFactory.decodeResource(getResources(), R.drawable.icon);
BitmapDrawable bd = new BitmapDrawable(bitmap);
bd.setTileModeXY(TileMode.REPEAT , TileMode.REPEAT );
bd.setDither(true);
view.setBackgroundDrawable(bd);

你可能感兴趣的:(Activity)