Fresco添加縮放支持
1. 添加gradle依賴
compile('com.facebook.fresco:fresco:1.0.0') {
excludemodule:'support-v4',group:'com.android.support'
}
// 配置fresco使用okhttp3發(fā)起網(wǎng)絡(luò)請求
compile('com.facebook.fresco:imagepipeline-okhttp3:1.0.0') {
excludemodule:'okhttp',group:'com.squareup.okhttp3'
}
// 實現(xiàn)縮放效果
compile'com.autonavi.gxdtaojin:lib-cview-photodraweeview:1.0.0'
2. 用PhotoDraweeView替換fresco默認(rèn)的SimpleDraweeView
mPhotoDraweeView.setPhotoUri(Uri.parse("http://your.image.url"));
3. 參考:
https://github.com/ongakuer/PhotoDraweeView
https://github.com/chrisbanes/PhotoView
Glide添加縮放支持
1. 添加gradle支持
// https://mvnrepository.com/artifact/com.github.bumptech.glide/glide
compilegroup:'com.github.bumptech.glide',name:'glide',version:'3.7.0'
// https://mvnrepository.com/artifact/com.github.chrisbanes.photoview/library
providedgroup:'com.github.chrisbanes.photoview',name:'library',version:'1.2.4'
2. 使用方法
首先通過glide給imageview設(shè)置bitmap,然后
3. 參考資料
https://github.com/chrisbanes/PhotoView