I have UIImageViewin UIScrollView, and I have some problems with the property contentOffset. Using an Apple link, this is defined as:
contentOffset : the point at which the start of the content view is offset from the start of the scroll.
For example, if the image is in the upper left corner of the screen, as shown below, then the contentOffset will be (0,0):
_________
|IMG |
|IMG |
| |
| |
| |
| |
---------
To rotate the device, I have the following setting:
scrollView.autoresizingMask = (UIViewAutoresizingFlexibleWidth |
UIViewAutoresizingFlexibleHeight);
imageView.autoresizingMask = (UIViewAutoresizingFlexibleWidth |
UIViewAutoresizingFlexibleHeight);
imageView.contentMode = UIViewContentModeCenter;
scrollView.contentMode = UIViewContentModeCenter;
This will make everything rotate around the center of the screen. After turning the screen, the screen will look like this:
______________
| IMG |
| IMG |
| |
--------------
, contentOffset, (0,0). ( UIImage , contentOffset , .)
UIImage . contentOffset , .
self.view.transform scrollView.transform, .