Tuesday, August 7, 2012

iOS 6 Auto Rotate and Orientation Changes on MonoTouch 5.99 (alpha)

In iOS6, auto rotate and orientation changes have changed quite significantly.

In a nutshell, these are the steps I took to upgrade my monotouch project to work with the new changes:

1. You will need to assign a root view controller to your main application window on FinishedLaunching. This is the crucial bit! I spent quite sometime figuring this out. Basically if you don't set your root view controller, you will get a warning in build output that looks like this: 

Application windows are expected to have a root view controller at the end of application launch

So if previously like me you have this in your FinishedLaunching(UIApplication app) method in main.cs:

Replace it with this:
window.RootViewController = mainVC;

2. Replace this:
public override bool ShouldAutorotateToInterfaceOrientation (UIInterfaceOrientation toInterfaceOrientation)

With these two lines:

public override bool ShouldAutorotate()
public override UIInterfaceOrientationMask SupportedInterfaceOrientations()

Obviously you will need to specify the orientation masks your view controller support in SupportedInterfaceOrientstions(). For example, if you support all orientations you might want to do this:

public override bool ShouldAutorotate()
return true;

public override UIInterfaceOrientationMask SupportedInterfaceOrientations()
return UIInterfaceOrientationMask.All;


That's my experience in getting auto rotation to work in ios 6 on MonoTouch 5.99. Check out the full release notes in the developer portal or if you don't have a login, you can check it out here.


  1. it should be: public override UIInterfaceOrientationMask GetSupportedInterfaceOrientations ()

    Otherwise great post!

  2. Finally! Point 1was the one little thing I missed.
    Thanks :)

  3. Great job for publishing such a beneficial web site. Your web log isn’t only useful but it is additionally really creative too. There tend to be not many people who can certainly write not so simple posts that artistically. Continue the nice writing
    uber unsere fair-dienst auf Website

  4. Hai Good information shared about IOS. In future everything about ios . This blog post is really helpful. Please keep updated tutorials…

  5. Gud information about iOS 6 Auto Rotate and Orientation.
    microsoft dynamics crm course

  6. Best Information on IOS 6 Auto Rotation and Orientation well While i was in kuwait where my PMP Certification in Kuwait has been taken and was also undergoing some project's in that one of them is IOS well thankyou for the blog

  7. Australia Best Tutor is one of the best Online Assignment Help providers at an affordable price. Here All Learners or Students are getting best quality assignment help with reference and styles formatting.

    Visit us for more Information

    Australia Best Tutor
    Sydney, NSW, Australia
    Call @ +61-730-407-305
    Live Chat @ https://www.australiabesttutor.com

    Our Services

    Online assignment help Australia
    my assignment help Australia
    assignment help
    help with assignment
    Online instant assignment help
    Online Assignment help Services

  8. Informative Blog on iOS 6 Auto Rotate and Orientation Changes on MonoTouch ... Thanks for your Valuable Information... MindMajix is providing Online Training on IOS Development Training.

  9. Each department of CAD have specific programmes which, while completed could provide you with a recognisable qualification that could assist you get a job in anything design enterprise which you would really like.

    AutoCAD training in Noida

    AutoCAD training institute in Noida

    Best AutoCAD training institute in Noida

  10. Your blog is very useful for me, Thanks for your sharing.


  11. When cooking with oil, you will see the fact that smoke usually receives emitted in case you often uses the identical oil. Typically, these form of eating places have today's hoods as well as exhaust fans.
    Visit here
    Kitchen Chimney Repair Service in Noida
    Kitchen Kitchen Chimney Repair Service in Vaishali
    Kitchen Kitchen Chimney Repair Service in indirapuram
    Kitchen Kitchen Chimney Repair Service in vasundhra
    Kitchen Kitchen Chimney Repair Service in faridabad