0

I've got the button on the fullscreen UIImageView and I want to pinch this view on that button press. I mean, I want to show only the part of the UIImage to the fullscreen after the button is pressed. Which method should I use?

asmn
  • 33
  • 6
  • 1
    Where are you doing the animation? A scroll view? If so check this SO post (http://stackoverflow.com/questions/172255/how-do-i-programatically-zoom-a-uiscrollview). I suggest you change the pinch in your title and description to "zoom in". – Fábio Oliveira Oct 02 '12 at 09:04
  • No, I use it in UIImageView and I want to scale the part of image to the whole screen – asmn Oct 02 '12 at 09:10
  • So, the UIImageView is not fullscreen and when you press a button you want to animate it to fullscreen? I suggest you edit your question to make it more clear. This way you have more chances of getting a good answer. – Fábio Oliveira Oct 02 '12 at 09:11
  • UIImageView is fullscreen and I want to show the part of the image to the full screen after the button pressing. – asmn Oct 02 '12 at 09:13

3 Answers3

1

Basically you can just start a zoom Animation, if that is all what you want.

Example:

[UIView animateWithDuration:1.0 animations:^{
    yourView.transform = CGAffineTransformMakeScale(2.0,2.0);
}];
calimarkus
  • 9,955
  • 2
  • 28
  • 48
0

Put your UIImageView inside a UIScrollView to get zooming and panning.

See this SO post. I've already used this technique and it's the only way I know to do it.

Community
  • 1
  • 1
Fábio Oliveira
  • 2,346
  • 21
  • 30
-1

you will want to use the pinchGestureRecognizer :)

http://developer.apple.com/library/ios/#DOCUMENTATION/UIKit/Reference/UIPinchGestureRecognizer_Class/Reference/Reference.html

Bob de Graaf
  • 2,630
  • 1
  • 25
  • 43
  • With the gesture recognizer it will recognize the pinch gesture. @asmn is asking to do the animation that would happen when pinching but by pressing a button. – Fábio Oliveira Oct 02 '12 at 09:04
  • ah ok read the question too fast I guess. Which + button is this anyway in Google Maps? – Bob de Graaf Oct 02 '12 at 09:06