zoukankan      html  css  js  c++  java
  • IOS开发之——获取屏幕的尺寸及各模拟器代表的型号

    获取屏幕尺寸

    [[[UIScreen mainScreen] currentMode].size.width];
    [[[UIScreen mainScreen] currentMode].size.height];
    
    也能够:
     NSLog(@"Frame Height:%f  Frame Width:%f",self.frame.size.height,self.frame.size.width); 

    如上的代码在不同设备上,得到的值是不同的。

    • iPhone (3.5 inch): 320 x 480    ——iphone3
    • iPhone Retina (3.5 inch): 640 x 960    ——iphone4,4s
    • iPhone Retina (4.0 inch): 640 x 1136    ——iphone5
    • iPad: 768 x 1024    ——ipad2,mini
    • iPad Retina: 1536 x 2048    ——ipad3,4
  • 相关阅读:
    HDU
    HDU
    HDU
    HDU
    西电网络赛
    西电网络赛
    西电网络赛
    西电网络赛
    西电网络赛
    西电网络赛
  • 原文地址:https://www.cnblogs.com/mfrbuaa/p/3832267.html
Copyright © 2011-2022 走看看