如果我双击它,我已经设法让我的应用程序放大我的图像,但它并没有放大我双击的地方!我希望图像以我双击的坐标为中心!
我的代码:
在 .h 文件中:
- (void)handleDoubleTap:(UIGestureRecognizer *)gestureRecognizer;
在 .m 文件中:
UITapGestureRecognizer *doubleTap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(handleDoubleTap:)];
[doubleTap setNumberOfTapsRequired:2];
[self.scroll addGestureRecognizer:doubleTap];
- (void)handleDoubleTap:(UIGestureRecognizer *)gestureRecognizer {
if(self.scroll.zoomScale > scroll.minimumZoomScale)
[self.scroll setZoomScale:scroll.minimumZoomScale animated:YES];
else
[self.scroll setZoomScale:1.6 animated:YES];
}
接下来我该怎么办?
提前致谢!
/一个菜鸟