如何将界面方向设置为所有视图

时间:2013-11-01 12:21:18

标签: ios interface-orientation

如何在iPhone应用程序中实现界面定位。我想将界面方向应用于所有视图控制器。

1 个答案:

答案 0 :(得分:2)

在AppDelegate.m文件集中:

景观

- (NSUInteger)application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window
{
    return UIInterfaceOrientationMaskLandscape;
}

肖像:

- (NSUInteger)application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window
{
    return UIInterfaceOrientationMaskPortrait;
}

对于两者:

- (NSUInteger)application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window
{
     return (UIInterfaceOrientationMaskAll);
}