簡體   English   中英

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

[英]How can I disable portrait mode in Windows 8?

我開發了一個不支持縱向模式的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

為了防止有人沒注意到編譯器警告,DisplayProperties現在已經過時了。 設置AutoRotationPreferences的新方法是,

DisplayInformation.AutoRotationPreferences = DisplayOrientations.Landscape;

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM