You need to add (don't avoid anyone) supportedInterfaceOrientations, shouldAutorotate and preferredInterfaceOrientationForPresentation for IOS 6, and for IOS < 6 shouldAutorotateToInterfaceOrientation and willRotateToInterfaceOrientation.
#pragma mark - Rotation IOS >= 6
- (NSUInteger)supportedInterfaceOrientations{
return UIInterfaceOrientationMaskPortrait;
}
- (BOOL)shouldAutorotate{
return YES;
}
- (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation {
return UIInterfaceOrientationPortrait;
}
#pragma mark - Rotation IOS < 6
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation{
return YES;
}
- (void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation
duration:(NSTimeInterval)duration{
// To avoid nav bar and view moved on rotation
[UIApplication sharedApplication].statusBarHidden = NO;
self.navigationController.navigationBar.hidden = YES;
self.navigationController.navigationBar.hidden = NO;
}
The red line is used to avoid status bar orientation change the bounds and frame of the actual UIViewController View, sometimes the Video in full screen make wear things on that...