下面是显示图片的Options
public static DisplayImageOptions getRoundedOptions(int cornerRadiusDp) {
return new DisplayImageOptions.Builder().showImageForEmptyUri(defaultDrawable)
.showImageOnFail(defaultDrawable)
.showImageOnLoading(defaultDrawable)
.cacheInMemory(true)
.cacheOnDisk(true)
.displayer(new RoundedBitmapDisplayer(ToolBox.dip2px(cornerRadiusDp)))
.bitmapConfig(Bitmap.Config.RGB_565)
.build();
}
其中 new RoundedBitmapDisplayer(ToolBox.dip2px(cornerRadiusDp))
用来实现圆角图片
显示图片
ImageLoader.getInstance().displayImage(imgUrl, imageView, getRoundedOptions(10));
问题来了
根本不显示图片,直角图片都没有。
解决办法
上网一顿查发现解决办法
ImageView设置android:background就可以解决问题,但是要是个drawable不能使用色值。