导包
在project的gradle中
allprojects {
repositories {
jcenter()
maven { url "https://jitpack.io" }
}
}
在module的gradle中
//photoView
compile 'com.github.chrisbanes:PhotoView:2.1.3'
//图片加载框架
compile 'com.squareup.picasso:picasso:2.5.2'
布局
//注意不能设置src,否则报错
<com.github.chrisbanes.photoview.PhotoView
android:id="@+id/iv_show_photo"
android:scaleType="fitCenter"
android:layout_width="match_parent"
android:layout_height="match_parent"/>