iOS 工程禁止屏幕旋转

在AppDelegate.m 中添加如下代码


- (NSUInteger)application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window

{

    if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad)

    {

        return UIInterfaceOrientationMaskAll;


    }

    else

    {

        return UIInterfaceOrientationMaskPortrait ;

    }

}

你可能感兴趣的:(ios,屏幕旋转,横屏)