0

for i want to build a movie controller,and it`s pushed by a navigationController,how can i set it ,also only this vc can be landscape,others should only be portraitUp,please help,thanks in advance.

  • possible duplicate of [How to force view controller orientation in iOS 8?](http://stackoverflow.com/questions/26357162/how-to-force-view-controller-orientation-in-ios-8) – Sunny Shah Jun 12 '15 at 04:30

1 Answers1

0

Try..

- (void)viewDidAppear:(BOOL)animated
{
    NSNumber *value = [NSNumber numberWithInt:UIInterfaceOrientationLandscapeLeft];
    [[UIDevice currentDevice] setValue:value forKey:@"orientation"];
}

- (void)viewDidDisappear:(BOOL)animated
{
    NSNumber *value = [NSNumber numberWithInt:UIInterfaceOrientationPortrait];
    [[UIDevice currentDevice] setValue:value forKey:@"orientation"];
}
Reming Hsu
  • 2,215
  • 15
  • 18