I have made a subclass of TTPhotoViewController, wich when I Rotate iPhone also the current image is rotated but NOT The navigation bar and the toolbar (the bar with prev and next button).
In my subclass I have overide the shouldAutorotateToInterfaceOrientation:
method:
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
return YES;
}
I've tried to overide willRotateToInterfaceOrientation:duration: e set up a breakpoint inside but seem that this method is never called.
I solved as follow:
TTPhotoViewController
was within aTabBarController
and by defaultTabBarController
doesn't returnYES
forshouldAutorotateToInterfaceOrientation
. So just subclass TabBarController and do something like that:I add a small detail: in my firts attempt to rotate the interface i've found that the
deviceOrientationDidChange:
inTTScrollView.m
was commeted out, this is done because if you decomment this code the scroll view have a strange behaviour on landascape rotation.