Skip to content
This repository was archived by the owner on Mar 26, 2025. It is now read-only.
This repository was archived by the owner on Mar 26, 2025. It is now read-only.

App crashes when I lock orientation to PortraitFlipped #14

Open
@Stensan

Description

@Stensan

Hi, in my app I need to change to PortraitFlipped at one time. But when I try to do this, the app crashes with this error:
Foundation.MonoTouchException: Objective-C exception thrown. Name: UIApplicationInvalidInterfaceOrientation Reason: Supported orientations has no common orientation with the application, and [Xamarin_Forms_Platform_iOS_PlatformRenderer shouldAutorotate] is returning YES

This is my Info.plist:

<key>UISupportedInterfaceOrientations</key>
<array>
	<string>UIInterfaceOrientationPortrait</string>
	<string>UIInterfaceOrientationPortraitUpsideDown</string>
	<string>UIInterfaceOrientationLandscapeLeft</string>
	<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>UISupportedInterfaceOrientations~ipad</key>
<array>
	<string>UIInterfaceOrientationPortrait</string>
	<string>UIInterfaceOrientationPortraitUpsideDown</string>
	<string>UIInterfaceOrientationLandscapeLeft</string>
	<string>UIInterfaceOrientationLandscapeRight</string>
</array>

In my AppDelegate I have put this:

[Export("application:supportedInterfaceOrientationsForWindow:")]
public UIInterfaceOrientationMask GetSupportedInterfaceOrientations(UIApplication application, IntPtr forWindow)
{
	return DeviceOrientationImplementation.SupportedInterfaceOrientations;
}

The other orientations are not causing trouble.
I am working with Xamarin.Forms, the device is an iPhone 8 and the crash occurs both on the real device and simulator.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions