iosinterface-orientation

Disabling rotation for current screen?


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


Solution

  • 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);
    }