iOS 6 rotation not working

前端 未结 3 879
暖寄归人
暖寄归人 2021-01-23 18:28

I have overridden my UINavigationController to implement these methods:

-(BOOL)shouldAutorotate
{
    return [[self.viewControllers lastObject] shouldAutorotate]         


        
3条回答
  •  花落未央
    2021-01-23 19:22

    I did this in this way

    -(BOOL) shouldAutorotate{
        return YES;
    }
    
    -(NSUInteger) supportedInterfaceOrientations{
        if ([self.visibleViewController isKindOfClass:[ZoomPictureViewController class]]) {
            return UIInterfaceOrientationMaskAll;
        }
        return UIInterfaceOrientationMaskPortrait;
    }
    

    Make sure you've clicked the orientation buttons in Xcode to enable the orientations you want and return the orientations in supportedInterfaceOrientations method.

提交回复
热议问题