You need to add (don’t avoid anyone) supportedInterfaceOrientations, shouldAutorotate and preferredInterfaceOrientationForPresentation for IOS 6, and for IOS < 6 shouldAutorotateToInterfaceOrientation and willRotateToInterfaceOrientation.
<pre style="background-color: #f0f0f0; background-position: initial initial; background-repeat: initial initial; border: 1px dashed rgb(204, 204, 204); font-family: arial; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;"> #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;
</pre><div style="background-color: white; font-family: arial, sans-serif; font-size: 13px;"> self.navigationController.navi
</pre>
}
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…
read