iOS8中的[UIScreen mainScreen].bounds 和 [UIScreen mainScreen].applicationFrame(下)

来源:互联网 发布:wifi渗透软件 编辑:程序博客网 时间:2024/04/26 12:57

对于先前给出的[UIScreen mainScreen].bounds 在iOS8里面的变化  

现给出一个万能的固定宽高的解决办法:

思路=====无论宽高怎么变化,数值最大的那个肯定是宽,相对的那个就是高

/**

如果想动态固定屏幕,现在的方法为:

根据[UIScreen mainScreen].bounds 虽然现在宽高是变化的

但是我们可以根据

* CGFloat w = [UIScreen mainScreen].bounds.size.width;

* CGFloat h = [UIScreen mainScreen].bounds.size.height;

*  if(w>h){w 为宽 h 为高}

*  if(h>w){h 为高 w 为宽} 搞定!

*/


0 0