I have this view controller with the following hierarchy:

I am just trying to load a photo and be able to scroll it and zoom it & autorotate it. Everything works well except I am getting some bad autorotation behavior. I’ve set the parent UINavigationController to allow rotation (by subclassing and overridng ‘shouldautororate..’) and I am now getting my window rotated but the scroll/imageview combination will just not fill the screen as need (on landscape it’ll be cut at 320p width). The struts and springs are set right. trying fiddling with scroll/imageview.autoresizesSubviews = YES – but it won’t help.
additionally I have to do some ‘ugly’ things as:
CGPoint cntr;// = {self.view.bounds.size.width/2, self.view.bounds.size.height/2};
if ([self interfaceOrientation] == UIInterfaceOrientationPortrait)
{
cntr.x = (self.view.bounds.size.width/2);
cntr.y = (self.view.bounds.size.height/2);
}
else
{
cntr.y = (self.view.bounds.size.width/2);
cntr.x = (self.view.bounds.size.height/2);
}
[spinner setCenter:cntr];
[self.imageView addSubview:spinner];
because the self.view.bounds will not update to represent the new landscape orientation size (always returns the portait dimensions). There must be something more elegant.
What am I doing wrong here?
You won’t need to do this, what you can do is to use autoresizing mask property. You can set the combination of following property as per your need- UIViewAutoresizingFlexibleWidth, UIViewAutoresizingFlexibleHeight, UIViewAutoresizingFlexibleLeftMargin , UIViewAutoresizingFlexibleRightMargin, UIViewAutoresizingFlexibleTopMargin , UIViewAutoresizingFlexibleBottomMargin