I have the following view hierarchy
- UIScrollView (horizontal scrolling)
- UIScrollView (vertical scrolling)
- UIViewController
- UIScrollView (vertical scrolling)
In fact there is a Root ScrollView Controller which has multiple Sub ScrollViews. (the Root ScrollViewController only scrolls horizontal - the sub ones only vertical). Each Sub ScrollView has an UIViewController.
My Root ScrollView Controller works as expected and calls my rotation methods which look like the following:
- (BOOL)shouldAutorotateToInterfaceOrientation (UIInterfaceOrientation)interfaceOrientation
{
return YES;
}
- (void) willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration
{
[self rotateScrollViewToInterfaceOrientation:toInterfaceOrientation];
}
- (void) rotateScrollViewToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
if (UIInterfaceOrientationIsLandscape(interfaceOrientation))
{
// do some rotation logic
}
}
I have used the same methods in my Sub ScrollViews and UIViewControllers but they don't get called on rotation.
Anyone has an idea why?