Objective c - UIActivityViewController orientation mode

前端 未结 4 1446
鱼传尺愫
鱼传尺愫 2021-01-21 09:40

My iPhone app is design to support portrait orientation only, except one view controller that present photos, and support landscape mode as well.

So overall my project

4条回答
  •  走了就别回头了
    2021-01-21 10:29

    i had similar problems in the app i am currently developing. i ended up overwriting more of the rotation methods to make sure my own viewcontroller stays in portrait.

    that's what worked for me (IOS5+):

    - (BOOL) shouldAutorotate {
        return YES;
    }
    
    - (NSUInteger)supportedInterfaceOrientations {
        return UIInterfaceOrientationMaskPortrait;
    }
    
    - (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation {
        return UIInterfaceOrientationPortrait;
    }
    
    - (BOOL)shouldAutorotateToInterfaceOrientation (UIInterfaceOrientation)interfaceOrientation {
        return (interfaceOrientation == UIInterfaceOrientationPortrait);
    }
    

    if you are pre ios5 or that's not working for you have a look at: http://developer.apple.com/library/ios/#documentation/uikit/reference/UIViewController_Class/Reference/Reference.html

    hope you get it to work. :)

提交回复
热议问题