문제

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