0
votes

I have UIViewController which supports only Portrait orientation.

In this viewController i have MPMoviePlayerController object. By default the movie controller supports both landscape and portrait orientations.

When it is in full screen mode and turned into landscape orientation the main view controller also changes his orientation, after exiting the full screen mode , the main view does not changes his orientation.

If I turn the device to portrait orientation, the main view automatically returns to the right orientation. The problem is that i dont want to rotate the main view even if the device is in landscape orientation.

Is there any way to prevent the main view to change its orientation when the movie controller rotates in full screen mode? or what is the right way to return main view into Portrait orientation.

1

1 Answers

0
votes
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation 

must return NO is iOS 5 or

- (NSUInteger)supportedInterfaceOrientations {
  return UIInterfaceOrientationMaskPortrait;
}

in iOS 6 in your ViewController.