Forcing landscape and autorotate in iOS 7

后端 未结 4 1707
太阳男子
太阳男子 2021-01-04 11:25

My app is supposed to be landscape only, and I had no problem with this when building for iOS 6 and earlier. Now with iOS 7, It won\'t rot

4条回答
  •  借酒劲吻你
    2021-01-04 12:21

    This solves my problem. I'm not sure why I had issues before, but I must have missed trying this exact combination (also, info.plist should have the supported orientations set).

    (NSUInteger)supportedInterfaceOrientations {
        return UIInterfaceOrientationMaskLandscape;
    }
    
    (BOOL)shouldAutorotate {
        return YES;
    }
    

    edit: I may have having issues with the simulator, and doing a reset/restart and clean might have contributed to the fix.

提交回复
热议问题