ShouldAutorotate and GetSupportedInterfaceOrientations are not called in Xamarin.iOS

I made a UIViewController for example

public class MyViewController : UIViewController
{
    ...

    public override bool ShouldAutorotate ()
    {
        return true;
    }

    public override UIInterfaceOrientationMask GetSupportedInterfaceOrientations ()
    {
        return UIInterfaceOrientationMask.AllButUpsideDown;
    }
}

and use it in AppDelegate.cs.

Window.RootViewController = new MyViewController();

When I run this code, “ShouldAutorotate” and “GetSupportedInterfaceOrientations” are called many times at the initialization stage, but after viewing the application they no longer ring.

I checked that the orientation setting in Info.plist is valid. The iOS SDK Target is 7.1, the version of Xamarin Studio 5.0.1 (build 3), and the version of Xamarin.iOS is 7.2.3.39.

Any ideas?

+4
source share
1 answer

iOS , .

0

Source: https://habr.com/ru/post/1544545/


All Articles