Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想在单击时显示放大和缩小效果。ImageView
ImageView
如何做到这一点?
提前致谢
您需要将图像视图添加为 UIScrollView 的子视图。您可以在滚动视图上安装 UITapGestureRecognizer 并将 numberOfTapsRequired 属性设置为 2。在手势识别器的回调方法中,只需将滚动视图的 zoomScale 属性设置为所需的缩放量。不要忘记在滚动视图上设置 maximumZoomScale 和 minimumZoomScale。