Forum Xamarin.iOS


The Xamarin Forums have officially moved to the new Microsoft Q&A experience. Microsoft Q&A is the home for technical questions and answers at across all products at Microsoft now including Xamarin!

To create new threads and ask questions head over to Microsoft Q&A for .NET and get involved today.

Xamarin Forms Orientation on iOS

DanSiegelDanSiegel USUniversity ✭✭

I'm working on a Xamarin Forms application that can support any orientation, but I am limited by a requirement that the app needs to lock the rotation to Portrait only by default and users have to opt into allowing Landscape rotation. While it's easy enough to expose the setting in the app or in the Settings.bundle, I have not found a way that actually works to change the allowed rotation at runtime.

I have already tried the following in the AppDelegate, but that doesn't seem to actually do anything:

public override UIInterfaceOrientationMask GetSupportedInterfaceOrientations( UIApplication application, UIWindow forWindow )
    if( PlatformSettings.Current.PortraitLock )
        return UIInterfaceOrientationMask.Portrait;

    return UIInterfaceOrientationMask.All;


Sign In or Register to comment.