WP Store APP 设置页面横竖屏的方法

在 windows phone store app 中,判断和设置页面横竖屏的方法,与 silverlight 中的 Page 类

不同,不能直接通过 Page.Orientation 进行设置。而是通过 DisplayInformation 类,方法如下:

// 横屏
Windows.Graphics.Display.DisplayInformation.AutoRotationPreferences = Windows.Graphics.Display.DisplayOrientations.Landscape; 

 

 

枚举值分别:

    [SupportedOn(100794368, Platform.Windows)]
    [SupportedOn(100794368, Platform.WindowsPhone)]

    public enum DisplayOrientations
 {None = 0,  Landscape = 1,Portrait = 2, LandscapeFlipped = 4, PortraitFlipped = 8, }

 

WP Store APP 设置页面横竖屏的方法,,5-wow.com

郑重声明:本站内容如果来自互联网及其他传播媒体,其版权均属原媒体及文章作者所有。转载目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。