zoukankan      html  css  js  c++  java
  • 不同ios系统下mainscreen的applicationFrame和bounds值測试


    打印结果(横屏,3.5寸。若4寸则最后一项对应添加)

    ios6:

    2014-04-26 10:57:12.300 testAccount[18525:907] applicationFrame: {{0, 20}, {320, 460}}
    2014-04-26 10:57:12.333 testAccount[18525:907] bounds: {{0, 0}, {320, 480}}

    ios7:
    2014-04-26 11:00:42.757 testAccount[2001:60b] applicationFrame: {{0, 20}, {320, 460}}

    2014-04-26 11:00:42.764 testAccount[2001:60b] bounds: {{0, 0}, {320, 480}}



    打印结果(竖屏。3.5寸,若4寸则最后一项对应添加)

    ios6:

    2014-04-26 10:57:12.300 testAccount[18525:907] applicationFrame: {{20, 0}, {300, 480}}
    2014-04-26 10:57:12.333 testAccount[18525:907] bounds: {{0, 0}, {320, 480}}

    ios7:
    2014-04-26 11:00:42.757 testAccount[2001:60b] applicationFrame: {{20, 0}, {320, 480}}
    2014-04-26 11:00:42.764 testAccount[2001:60b] bounds: {{0, 0}, {320, 480}}


    结论: frame和bounds的值和它们的字面意思一样,一个包括了最上面的20的状态栏,1个不包括。系统的不同不会对这两个值造成影响。

    因此无法用这两个值来直接对系统进行适配。还须要使用详细的方法来区分。

    我这边对于手写的代码定义了:#define IOS7Plus (fabs((double)[[UIDevice currentDevice].systemVersion doubleValue])>=7.0f)宏,

    使用该宏来推断系统对不同系统下的view尺寸赋值。  大家若有好办法,请告诉我一下,多谢!



  • 相关阅读:
    苦逼也聊模式--(0)--开篇
    发现无力吐槽
    JS函数调用
    初步使用nodejs(一)
    测试一下
    达摩流浪者
    Revit:二开使用Sqlite保存本地数据,并配合EF6等ORM框架
    Revity:查找并修改类型参数和实例参数
    复习一下UML
    Revit:ElementFilter过滤器基类
  • 原文地址:https://www.cnblogs.com/zsychanpin/p/6704941.html
Copyright © 2011-2022 走看看