PhotoView 是一款扩展自
Android
ImageView,支持通过单点/多点触摸来进行图片缩放的智能控件。
特性:
支持单点/多点触摸,即时缩放图片;
支持平滑滚动;
在滑动父控件下能够运行良好;(例如:ViewPager)
当用户的触点改变是可以触发通知
和ViewPager等能完美兼容
需要在as最外面的那一层
添加权限
allprojects
{repositories { maven { url
"https://jitpack.io"
} }}
然后在项目下添加
dependencies
{ compile
'com.github.chrisbanes:PhotoView:latest.release.here'
}
之后只需要在布局文件中
<com.github.chrisbanes.photoview.PhotoView
android:id="@+id/pv"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
就可以使用了