1
我想只更改一個UiViewController的設備方向。我的第一個UiViewController的名字是VideoLaunch。我首先需要在此UiViewController中使用橫向方向。當我通過另一個uiviewcontroller時,我將名稱爲「is」的靜態值更改爲不同於nil。當我在調試模式下運行,我看到Objective-C僅更改一個UiViewController的設備方向
否則返回UIInterfaceOrientationMaskPortrait
這條線運行。但方向不會改變。
AppDelegate.m
- (NSUInteger)application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window {
if([VideoLaunch is] == nil)
return UIInterfaceOrientationMaskLandscape;
else return UIInterfaceOrientationMaskPortrait;
}
檢查此問題http://stackoverflow.com/questions/27009979/ios-lock-a-specific-uiviewcontroller-to-a-specific-orientation – Rishab