在启用分页和多个图像的情况下放大UIScrollView

Ahm*_*med 3 iphone objective-c uiscrollview uiimageview image-zoom

我有一个UIScrollviewUIImageView在那里我从一个图像到另一个滚动内.

我使用TapToZoom Apple示例代码来实现缩放,但每当我缩放时,滚动视图都从开始而不是活动图像开始.

这是我的一段代码:

初始化并填充imageview:

table = [[NSMutableArray alloc] initWithCapacity:7];
for(int count = 1; count <= 7; count++)
{
    NSString *fileName = [NSString stringWithFormat:@"image%d.jpg", count];
    UIImage  *image    = [UIImage imageNamed:fileName];
    [table addObject:image];
    if (image == nil) {
        break;
    }
    imageView = [[UIImageView alloc] initWithImage:image];
    imageView.userInteractionEnabled = YES;
    imageView.multipleTouchEnabled = YES;
Run Code Online (Sandbox Code Playgroud)

实施Tap手势:

UITapGestureRecognizer *singleTap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(handleSingleTap:)];
    UITapGestureRecognizer *doubleTap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(handleDoubleTap:)];
Run Code Online (Sandbox Code Playgroud)

handleDoubleTap方法缩放到中心,imageView并将scrollview带到分页的开始.

我对此进行了大量搜索,但无法找到放大实际显示图像的方法.

提前致谢 :)