0

I have the current code to enlarge UIImageView:

- (void)handlePinch:(UIPinchGestureRecognizer *)pinchGestureRecognizer
{
    mCurrentScale += [pinchGestureRecognizer scale] - mLastScale;
    mLastScale = [pinchGestureRecognizer scale];

    if (pinchGestureRecognizer.state == UIGestureRecognizerStateEnded)
    {
        mLastScale = 1.0;

    }

    CGAffineTransform currentTransform = CGAffineTransformIdentity;
    CGAffineTransform newTransform = CGAffineTransformScale(currentTransform, mCurrentScale, mCurrentScale);
    thumbView.transform = newTransform;
}

Image is located in right corner and if I enlarge half of image gores out of View, how can I enlarge image in that way it stays in right corner and shown properly?

4

1 に答える 1

0

CGAffineTransformTranslate を使用してズーム時に左に移動しますか?

于 2012-11-01T14:02:17.550 に答える