惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

J
Java Code Geeks
月光博客
月光博客
D
DataBreaches.Net
云风的 BLOG
云风的 BLOG
F
Fortinet All Blogs
T
The Blog of Author Tim Ferriss
Stack Overflow Blog
Stack Overflow Blog
Blog — PlanetScale
Blog — PlanetScale
aimingoo的专栏
aimingoo的专栏
U
Unit 42
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
MyScale Blog
MyScale Blog
T
Tailwind CSS Blog
N
Netflix TechBlog - Medium
B
Blog
博客园_首页
G
Google Developers Blog
Recent Announcements
Recent Announcements
博客园 - 【当耐特】
P
Proofpoint News Feed
博客园 - 司徒正美
Hugging Face - Blog
Hugging Face - Blog
MongoDB | Blog
MongoDB | Blog
Last Week in AI
Last Week in AI

博客园 - 十二号的国王

【iOS开发】在ARC项目中使用非ARC文件 实现ZUNE上软件商城的软件星级推荐效果 [Windows Phone 7]开发分享图片的插件(2) [Windows Phone 7]如何判断手机是否有网络连接 [Windows Phone 7]开发分享图片的插件(1) [Windows Phone 7]如何导航页面和页面间传值 [Windwos Phone 7] Accelerometer [Windwos Phone 7] 获取设备相关信息 [Windows Phone 7] 常用资源(转) [Windows Phone 7] Storage XNA:保存数据到文件和从文件读取数据 XNA项目运行错误:No suitable graphics card found. POOM(Pocket Outlook Object Model)开发介绍及应用(转) 剪贴板剪切/复制与粘贴文件+1个待解决的问题 c#枚举-Enum C#读写INI配置文件(转) C#3.0新增特性 - 十二号的国王 - 博客园 关于DBNull vs 快捷键
[Windows Phone 7]UI对屏幕的自适应的处理
十二号的国王 · 2010-11-22 · via 博客园 - 十二号的国王

        对于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,
    }