zoukankan      html  css  js  c++  java
  • [Windows Phone 7]UI对屏幕的自适应的处理

            对于WP7的Silverlight项目默认Portrait mode而XNA项目默认是Landscape mode的,要想改变这个初始的模式的话,可以通过更改PhoneApplicationPage页面的SupportedOrientations这个属性。

            SupportedOrientations属性有三个枚举值,分别是:Landscape(支持水平方向)、Portrait(支持垂直方向)、PortraitOrLandscape(支持水平和垂直方向)。

            开发者也可以通过VS来新增水平或者垂直的新的Page。

            UI想响应屏幕的变化,可以通过PhoneApplicationPage的OrientationChanged事件来处理,通过OrientationChangedEventsArgs类型的参数e的Orientation的值来确定现在手机的方向。其中,Orientation的值是PageOrientation的枚举值。

    PageOrientation的枚举的定义如下:

        // Summary:
        // An enumeration defining the possible orientations of a page.
        public enum PageOrientation
        {
            // Summary:
            // No orientation is specified.
            None = 0,
            //
            // Summary:
            // Portrait orientation.
            Portrait = 1,
            //
            // Summary:
            // Landscape orientation.
            Landscape = 2,
            //
            // Summary:
            // Portrait orientation.
            PortraitUp = 5,
            //
            // Summary:
            // Portrait orientation.
            PortraitDown = 9,
            //
            // Summary:
            // Landscape orientation with the top of the page rotated to the left.
            LandscapeLeft = 18,
            //
            // Summary:
            // Landscape orientation with the top of the page rotated to the right.
            LandscapeRight = 34,
        }
  • 相关阅读:
    prometheus,alertmanager 报警配置详解
    使用 kubeadm 搭建 kubernetes1.10 集群
    kibana-sentinl-监控报警
    ELK集群模式部署
    mongo 误操作恢复数据
    mongo 实时同步工具 mongosync
    移动端巨坑——iphone6Plus默认设置不使用sessionStorage
    iphone6 Plus seesionStorage失效
    移动端手势拖拽排序神器Sortable.js
    vue使用swiper(转)
  • 原文地址:https://www.cnblogs.com/ssqjd/p/1884803.html
Copyright © 2011-2022 走看看