1

I was trying to add a pinch gesture zoom-in zoom-out feature to a UITextView and then I decided that adding a pinch gesture which zooms the whole screen, covering the whole view hierarchy is a better and more general solution. But I am confused about how to do it: Should I change the frame sizes of all UIView objects or should I somehow scale them? What is the most correct way to do it?

Ufuk Can Bicici
  • 3,589
  • 4
  • 28
  • 57

1 Answers1

2

Put all your views in a UIScrollView and then return the view in this delegate method of UIScrollView

- (UIView *)viewForZoomingInScrollView:(UIScrollView *)scrollView
tkanzakic
  • 5,499
  • 16
  • 34
  • 41
ask4asif
  • 676
  • 4
  • 10
  • Ok, but what if I have an another scrollview inside this root scrollview? Wouldn't it lead to a confusion about which scroll view is going to get scrolled? – Ufuk Can Bicici Dec 23 '12 at 15:48
  • You can give tags to UIScrollView and then this tag in this delegate method. – ask4asif Dec 23 '12 at 16:03