Android Glide详解

2019-04-15 15:43发布

glide依赖: implementation 'com.github.bumptech.glide:glide:4.6.1' String url = "http://b.hiphotos.baidu.com/image/pic/item/dbb44aed2e738bd43212040dac8b87d6277ff9df.jpg"; RequestOptions optionsce = new RequestOptions() .centerCrop();//突出中间 RequestOptions optionsf = new RequestOptions() .fitCenter();//原型 RequestOptions optionsci = new RequestOptions() .circleCrop();//圆形图片 RequestOptions options = new RequestOptions() .override(200, 100);//指定尺寸 RequestOptions options2 = new RequestOptions() .placeholder(R.drawable.ic_camera);//占位图 Glide.with(this) .load(url) .apply(options)//图片展示类型方法 .into(imageView);