[英]Forbid auto orientation to Landscape, can manually set one controller to landscape
我禁止整個應用程序面向景觀。 但是我只允許一個視圖控制器--- MPMoviePlayerController自動旋轉,我知道我可以手動旋轉視圖,但是狀態欄仍然是縱向的。
我已經設置了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>
我不希望整個應用程序都能自動定位。
所以我的問題是:
我是否只能允許此視圖自動定向為橫向(我已經禁止將應用程序定向為橫向)。
如果1為否,那么是否有將狀態欄設置為橫向模式的方法?
謝謝
在橫向模式下設置狀態欄,如下所示:
[[UIApplication sharedApplication] setStatusBarOrientation:UIDeviceOrientationLandscapeLeft animated:NO]
並讓您的狀態欄旋轉。 嘗試如下:
-(BOOL)shouldAutorotate
{
return YES;
}
- (NSUInteger)supportedInterfaceOrientations
{
return UIInterfaceOrientationMaskLandscape;
}
同時在設備上進行測試。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.