【问题标题】:iOS Landscape orientation issue for MonoGameMonoGame 的 iOS 横向方向问题
【发布时间】:2013-07-27 16:46:47
【问题描述】:

在 Mac OS X 上使用 Xamarin 4.0.10 和最新版本的 MonoGame for iOS。 我的横向方向有问题。

MonoTouch.Foundation.MonoTouchException:抛出 Objective-C 异常。 名称:UIApplicationInvalidInterfaceOrientation 原因:支持 方向与应用程序没有共同的方向,并且 shouldAutorotate 返回 YES

如果我添加 Portait 方向,一切都很好。但我只需要横向。

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

这个问题是在game.Run()方法上启动构造函数Game1.cs后出现的

【问题讨论】:

    标签: ios landscape monogame


    【解决方案1】:

    在 Xamarin Studio 中打开 Info.plist 并检查“支持的设备方向”中的“横向左”和“横向右”方向。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-02-23
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多