【问题标题】:UIScrollView zooming in a fixed point, and disable the pinch in/outUIScrollView 放大固定点,并禁用捏合/拉出
【发布时间】:2012-01-28 22:04:05
【问题描述】:

我遇到了 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];}

提前谢谢。

【问题讨论】:

    标签: ios ipad uiscrollview uiimageview uiscrollviewdelegate


    【解决方案1】:

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

    【讨论】:

      猜你喜欢
      • 2013-02-17
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-09-23
      • 1970-01-01
      • 2014-09-20
      • 1970-01-01
      • 2013-01-19
      相关资源
      最近更新 更多