iPhone/iPad App Orientation

后端 未结 4 1270
天命终不由人
天命终不由人 2021-01-22 10:24

The iPhone version of my app supports UIDeviceOrientationPortraitUpsideDown and UIDeviceOrientationPortrait, but the iPad version supports all Orientat

4条回答
  •  花落未央
    2021-01-22 10:40

    Another way to support orientations is to subclass UINavigationController and add your orientation code there

    i.e

    //IOS 5
    - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation{
        return YES;
    }
    //IOS 6
    - (BOOL)shouldAutorotate {
        return YES;
    }
    - (NSUInteger)supportedInterfaceOrientations {
        return UIInterfaceOrientationMaskAll;
    }
    

    this worked for me, using storyboards

提交回复
热议问题