EEZoomableImageView
提供フルスクリーンズーム機能の UIImageView とインスタグラムのような機能。
EEZoomableImageView 做什么?
有无需额外代码即可为 UIImageView 提供全屏缩放功能。
它处理屏幕上的触摸变化数量。据我所知,没有像用户从屏幕中移除手指时图像中心跳跃的奇怪行为。
设置
使用 CocoaPods(推荐)
将以下行添加到您的 Podfile;
pod 'EEZoomableImageView'
然后您可以使用 pod install 命令安装它。
手动
下载示例项目,只需将 EEZoomableImageView.swift 文件拖放到您的项目中。
用法
将您的图像视图子类化为 EEZoomableImageView。就是这样简单。
可自定义参数
可以通过 EEZoomableImageView 实例设置自定义参数
@IBOutlet weak var zoomableImageView: EEZoomableImageView! {
didSet {
zoomableImageView.minZoomScale = 0.5
zoomableImageView.maxZoomScale = 3.0
zoomableImageView.resetAnimationDuration = 0.5
zoomableImageView.zoomDelegate = self
}
}
- minZoomScale: 缩放图像视图的最小比例。默认值为 1.00
- maxZoomScale: 缩放图像视图的最大比例。默认值为 3.00
- resetAnimationDuration: 重置动画的持续时间。默认值为 0.3 秒
- zoomDelegate: 在缩放开始和结束时,Zoom Delegate 会被通知。
- isZoomingActive: 标志表明是否正在缩放。 (只读)
问题或建议
请发送电子邮件给我([email protected])