在android开发中,如何实现图片平铺。下面整理了三种实现方式:
第一种 利用系统提供的api实现
Bitmap bitmap = BitmapFactory.decodeResource(getResources(), R.drawable.pic);
//bitmap = Bitmap.createBitmap(200, 30, Config.ARGB_8888);
BitmapDrawable drawable = new BitmapDrawable(bitmap);
drawable.setTileModeXY(TileMode.REPEAT , TileMode.REPEAT );
drawable.setDither(true);
view.setBackgroundDrawable(drawable);
第二种 使用xml来轻松实现
<bitmap xmlns:android="schemas.android/apk/res/android" android:src="blog.csdn.net/com360/ar
上一篇:
android开发教程1.4.1启动与销毁activity
下一篇:
试论APP广告在手机中的应用