I have a UIScrollView containing an UIImageView and I have some trouble to get the correct behavior when the iPhone rotates.
Goal: I am trying to o
Try this:
scrollView.autoresizingMask = (UIViewAutoresizingFlexibleWidth |
UIViewAutoresizingFlexibleHeight);
imageView.autoresizingMask = (UIViewAutoresizingFlexibleWidth |
UIViewAutoresizingFlexibleHeight);
imageView.contentMode = UIViewContentModeAspectFit; // You could also try UIViewContentModeCenter
I'm not sure if the imageView will get automatically resized within a UIScrollView, so if the autoresizing doesn't work, you could try setting the frame yourself on rotate to equal the size of the scrollview.