IPad View doesn't spin

So far I have a very simple application and it will not rotate the view. ShouldAutorotateToInterfaceOrientationCalled when the application starts, but never rotates again. My code is as follows:

public class NotebookSelectionController : UIViewController {

    public override bool ShouldAutorotateToInterfaceOrientation(UIInterfaceOrientation toInterfaceOrientation) {
            return true;
     }
}

My delegate application code is as follows:

public override bool FinishedLaunching(UIApplication app, NSDictionary options) {
    var notebookController = new NotebookSelectionController();
    window.AddSubview(notebookController.View);

    window.MakeKeyAndVisible();

    return true;
}

What am I missing?

+3
source share
1 answer

Does he work in a simulator? When you open the "Equipment" / "Rotation" menu in the simulator, for example, on the left? If it works there, make sure that on the device you don’t have autorotation disabled by iOS - using the switch or in the multitasking panel.

Stupid mistakes happened to me many times :)

, , , .

0

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


All Articles