UIScrollView缩放固定点,并禁用插入/缩小

时间:2012-01-28 22:04:05

标签: ios ipad uiscrollview uiimageview uiscrollviewdelegate

我遇到了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];}
提前thx。

1 个答案:

答案 0 :(得分:1)

我在`UIScrollView中禁用了缩放功能,检查了Interface Builder中触摸部分下的所有适当性。