c# - 如何禁用 Windows 8 中的纵向模式?

标签 c# orientation windows-8 windows-runtime

我开发了一个不支持纵向模式的 XAML/C# Windows 8 应用程序。我在 Visual Studio 中打开了 Package.appxmanifest,并在“支持的旋转”下禁用了纵向和纵向翻转模式。这创建了以下旋转首选项:

        <InitialRotationPreference>
          <Rotation Preference="landscape" />
          <Rotation Preference="landscapeFlipped" />
        </InitialRotationPreference>

但是,当我在模拟器中启动我的应用程序并旋转模拟器时,该应用程序仍会旋转到纵向模式。我怎样才能防止这种情况发生?

谢谢,

阿德里安

最佳答案

Windows 8 中的模拟器似乎不尊重您的旋转首选项。不幸的是,在连接到运行 Windows 8 的实际平板电脑之前,无法判断这些设置是否按预期工作。

查看这篇文章以获取更多信息,直接来自 MSDN:http://msdn.microsoft.com/en-us/library/windows/apps/windows.graphics.display.displayproperties.autorotationpreferences

关于c# - 如何禁用 Windows 8 中的纵向模式?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11260919/

相关文章:

用于旋转 3D 立方体的 Android 方向传感器

css - 只有横向模式适用于 iPad 纵向(CSS)

c# - 在 Winrt 和 MVVM 模式中显示来自 Uri 的图像

Windows 8 语音转文本和文本转语音 API

c# - 如何在 RetryPolicy<HttpResponseMessage> 上使用策略包装?

c# - 通过数据库使用 ViewModel 填充 DataGrid

ios - 在 ipad ios 5.0 版本中无法以横向模式显示应用程序

android - Eclipse 无法识别我的 Android 手机 (HTC Sensation)

c# - 读取二进制文件并使用 Response.BinaryWrite()

c# - 单声道项目 : Why is mono faster than . NET?