Used Xamarin 4.0.10 and last version MonoGame for iOS on Mac OS X. I have a problem with Landscape orientation.

MonoTouch.Foundation.MonoTouchException: Objective-C exception thrown. Name: UIApplicationInvalidInterfaceOrientation Reason: Supported orientations has no common orientation with the application, and shouldAutorotate is returning YES

If I add Portait orientation everything is fine. But I need only Landscape orientation.

graphics = new GraphicsDeviceManager(this);
graphics.PreferredBackBufferHeight = 640;
graphics.PreferredBackBufferWidth = 960;
graphics.SupportedOrientations = DisplayOrientation.LandscapeLeft | DisplayOrientation.LandscapeRight;
graphics.ApplyChanges ();
Content.RootDirectory = "Content";
graphics.IsFullScreen = true;

This problem is appears after start constructor Game1.cs on the method game.Run()

有帮助吗?

解决方案

Open Info.plist in Xamarin Studio and check 'Landscape Left' and 'Landscape Right' orientation in 'Supported Device Orientations'.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top