Disabling rotation for current screen?

后端 未结 2 1571
情书的邮戳
情书的邮戳 2020-12-22 01:14

Is it possible to enable/disable rotation parameter for current screen or this property is for all application?

2条回答
  •  心在旅途
    2020-12-22 01:43

    Sure:

    - (BOOL)shouldAutorotate
    {
        return YES;
    }
    
    - (NSUInteger)supportedInterfaceOrientations
    {
        //Choose your available orientation, you can also support more tipe using the symbol |
        //e.g. return (UIInterfaceOrientationMaskLandscapeLeft | UIInterfaceOrientationMaskLandscapeRight)
        return (UIInterfaceOrientationMaskPortrait);
    }
    

提交回复
热议问题