-2

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.

jscs
  • 63,694
  • 13
  • 151
  • 195
dannysandler
  • 1,881
  • 4
  • 16
  • 14

2 Answers2

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