如何在Windows 8中禁用纵向模式?

Adr*_*ore 9 c# orientation windows-8 windows-runtime

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

        <InitialRotationPreference>
          <Rotation Preference="landscape" />
          <Rotation Preference="landscapeFlipped" />
        </InitialRotationPreference>
Run Code Online (Sandbox Code Playgroud)

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

谢谢,

阿德里安

小智 7

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

有关更多信息,请参阅此文章,直接来自MSDN:http://msdn.microsoft.com/en-us/library/windows/apps/windows.graphics.display.displayproperties.autorotationpreferences