UIScrollView 定点放大,并禁用捏合/捏合
我遇到了 UIScrollView 的问题,
我希望当用户点击特定点时缩放滚动视图,并阻止用户使用捏缩放手势放大/缩小,我该怎么做?
[imgScroll setDelegate:self];
float minimumScale = [imgScroll frame].size.height / [imageView frame].size.height;
[imgScroll setMinimumZoomScale:minimumScale];
[imgScroll setZoomScale:minimumScale];
- (UIView *)viewForZoomingInScrollView:(UIScrollView *)scrollView {
return [imageView viewWithTag:ZOOM_VIEW_TAG];}
- (void)scrollViewDidEndZooming:(UIScrollView *)scrollView withView:(UIView *)view atScale:(float)scale {
[scrollView setZoomScale:scale+0.01 animated:NO];
[scrollView setZoomScale:scale animated:NO];}
提前谢谢。
i'm stuck on a problem with UIScrollView
i wanna the scroll view be zoomed when the user tap on a specific point, and prevent the user to zoom in/out using Pinch Zoom Gestures, how can i do it?
[imgScroll setDelegate:self];
float minimumScale = [imgScroll frame].size.height / [imageView frame].size.height;
[imgScroll setMinimumZoomScale:minimumScale];
[imgScroll setZoomScale:minimumScale];
- (UIView *)viewForZoomingInScrollView:(UIScrollView *)scrollView {
return [imageView viewWithTag:ZOOM_VIEW_TAG];}
- (void)scrollViewDidEndZooming:(UIScrollView *)scrollView withView:(UIView *)view atScale:(float)scale {
[scrollView setZoomScale:scale+0.01 animated:NO];
[scrollView setZoomScale:scale animated:NO];}
thx in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

我禁用了 UIScrollView 中的缩放属性,检查了 Interface Builder 中触摸部分下的所有属性。
I was disable the zoom propriety in the `UIScrollView, checked all the propriety under the touch section in Interface Builder.