UIScrollView Zooming Glitches…

The other days, I have been implementing app for my company. One of the parts of the app is image zooming. I am using UIScrollView and UIImageView for this.

- (void) viewDidLoad
   [super viewDidLoad];
   self.myScrollView.minimumZoomScale = 1.0;
   self.myScrollView.maximumZoomScale = 5.0;
   self.myScrollView.contentSize = CGSizeMake(939, 704);
   self.myScrollView.delegate = self;

- (UIView *) viewForZoomingInScrollView:(UIScrollView *)scrollView
   return self.myImageView;

But when I tested with actual device which is on iOS 6, I found out that zooming caused so much glitches and after zooming, picture is also out of position. Again I tested the same app on device with iOS 7, there is no glitches. It’s so wired, isn’t it!

Googling pointed me to this. Although actual answer was not helping, comments on answer did help me!

It was because I was using Autolayout in Storyboard! When I un-ticked “Use Autolayout” from my View in storyboard, it’s working fine in both iOS 6 and 7 now!
Of course, I have to do all the alignment on views again to work on both iOS 6 and 7.

It’s just a small things but I felt like “phew!”. :)

Also read...

Leave a Reply