【发布时间】:2016-03-02 13:00:58
【问题描述】:
我只想为一个 UiViewController 更改设备方向。我的第一个 UiViewController 的名字是 VideoLaunch。我首先想要这个 UiViewController 中的横向方向。当我传递另一个 uiviewcontroller 时,我将一个名为“is”的静态值更改为与 nil 不同。当我在调试模式下运行时,我看到了
否则返回 UIInterfaceOrientationMaskPortrait
这条线运行。但方向没有改变。
AppDelegate.m
- (NSUInteger)application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window {
if([VideoLaunch is] == nil)
return UIInterfaceOrientationMaskLandscape;
else return UIInterfaceOrientationMaskPortrait;
}
【问题讨论】:
标签: objective-c iphone device-orientation