0
votes

I forbid whole app orientation to landscape. But I want to allow only one view controller --- MPMoviePlayerController auto rotate, I knew I can rotate view manually, but the status bar still in portrait.

I've set info.plist

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<array>
    <string>UIInterfaceOrientationPortrait</string>
    <string>UIInterfaceOrientationPortraitUpsideDown</string>
</array>
</plist>

I don't want the entire app can auto orientation.

So my problem is:

  1. Whether I can just allow this view auto orientation landscape (I've already forbidden app orientation to landscape).

  2. If 1 is NO, then, is there anyway to set status bar to landscape mode?

thanks

1

1 Answers

0
votes

Set status bar in landscape mode like below:

[[UIApplication sharedApplication] setStatusBarOrientation:UIDeviceOrientationLandscapeLeft animated:NO]

And for your status bar to rotate. Try like below:

-(BOOL)shouldAutorotate
{
    return YES;
}
- (NSUInteger)supportedInterfaceOrientations
{
    return UIInterfaceOrientationMaskLandscape;
}

Also test it on device.