Hi All,
I'm pretty new to MonoTouch and I'm having problems getting my app to rotate from portrait to landscape mode.
My project has two XIB files, the MainWindow
added by MonoTouch and MainController.xib
which I have added. The MainController
has a single label and no other controls. In my Main.cs
I have the following to load the MainController.xib
file:
UIViewController controller = new MainController();
window.AddSubview(controller.View);
In the MainController
code I added
public override bool ShouldAutorotateToInterfaceOrientation (UIInterfaceOrientation toInterfaceOrientation)
{
return false;
}
It all runs fine and the label displays but when I rotate the simulator nothing rotates. I'm sure it's something really simple that I'm getting wrong but I just can't seem to crack it.
Any help would be appreciated.