scrollView.delegate = self
//設(shè)置最大最小縮放比例
scrollView.maximumZoomScale = 4.0
scrollView.minimumZoomScale = 1.0
//scrollView的delegate
func viewForZooming(in scrollView: UIScrollView) -> UIView? {
return imageView
}
具體可看蘋果官方文檔
scrollView.delegate = self
//設(shè)置最大最小縮放比例
scrollView.maximumZoomScale = 4.0
scrollView.minimumZoomScale = 1.0
//scrollView的delegate
func viewForZooming(in scrollView: UIScrollView) -> UIView? {
return imageView
}
具體可看蘋果官方文檔