How to force a UIViewController to Portrait orientation in iOS 6

后端 未结 16 1527
别那么骄傲
别那么骄傲 2020-11-22 06:03

As the ShouldAutorotateToInterfaceOrientation is deprecated in iOS 6 and I used that to force a particular view to portrait only, what is the c

16条回答
  •  误落风尘
    2020-11-22 06:37

    For Monotouch you could do it this way:

    public override UIInterfaceOrientationMask GetSupportedInterfaceOrientations()
        {
        return UIInterfaceOrientationMask.LandscapeRight;
    }
    
    public override UIInterfaceOrientation PreferredInterfaceOrientationForPresentation()
        {
        return UIInterfaceOrientation.LandscapeRight;
    }
    

提交回复
热议问题