I have an iOS 7 app, and I don't want the whole interface to be landscape, but when a user plays a video I want it to play in landscape. I don't have many view controllers, so I'm fine implementing something in each individual controller.
Asked
Active
Viewed 222 times
-2
-
be sure to provide some example code so people will be more able to help you – Frakcool May 17 '14 at 17:32
2 Answers
0
You could force the view into landscape when a video is playing, then after it has finished, force the app into portrait again.
Check this out: force landscape ios 7

Community
- 1
- 1

Jake Chasan
- 6,290
- 9
- 44
- 90
0
Add this category somewhere:
@interface UINavigationController (rotation)
@end
@implementation UINavigationController (rotation)
#pragma mark - Rotation
- (BOOL)shouldAutorotate {
return NO;
}
- (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation {
return UIInterfaceOrientationPortrait;
}
- (NSUInteger)supportedInterfaceOrientations {
return UIInterfaceOrientationMaskPortrait;
}
// ios4 and ios5
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
return (interfaceOrientation == UIInterfaceOrientationPortrait);
}
@end

orkenstein
- 2,810
- 3
- 24
- 45