Cannot rotate interface orientation to portrait upside down

前端 未结 3 977
礼貌的吻别
礼貌的吻别 2021-01-18 10:41

Both on iPhone simulator and iPhone 3GS (iOS 6) I cannot manage to set the orientation to portrait upside down. I have just one ViewController. I\'ve added this code in it:<

3条回答
  •  误落风尘
    2021-01-18 11:13

    supportedInterfaceOrientations returns an NSUInteger. It returns all of the interface orientations that the view controller supports, a mask of interface orientation values.

    You need to return values defined in UIInterfaceOrientationMask Enum, like the following shows:

    - (BOOL)shouldAutorotate {
        return YES;
    }
    
    - (NSUInteger)supportedInterfaceOrientations {
        return (UIInterfaceOrientationMaskPortrait | UIInterfaceOrientationMaskPortraitUpsideDown);
    }
    

提交回复
热议问题