分享

iphone尺寸

 Rdxer馆 2015-10-13

iphone6plus 1080x1920

iphone6 750x1334

iphone5-5c-5s 640x1136

iphone4-4s 640x960

iphone iPod touch 320x480

#define IS_IPHONE ([[[UIDevice currentDevice] model] isEqualToString:@"iPhone Simulator"])// Simulator

#define IS_IPOD ([[[UIDevice currentDevice] model] isEqualToString:@"iPod touch"])

#define IS_HEIGHT_GTE_568 [[UIScreen mainScreen] bounds].size.height >= 568.0f

#define IS_HEIGHT_GTE_667 [[UIScreen mainScreen] bounds].size.height >= 667.0f

#define IS_HEIGHT_GTE_736 [[UIScreen mainScreen] bounds].size.height >= 736.0f

#define IS_IPHONE_5 (IS_IPHONE && IS_HEIGHT_GTE_568)

#define IS_IPHONE_6 (IS_IPHONE && IS_IPHONE_5 && IS_HEIGHT_GTE_667)

#define IS_IPHONE_6_PLUS (IS_IPHONE && IS_IPHONE_6 && IS_HEIGHT_GTE_736)

NSLog(@"X:%f,Y:%f,W:%f,H:%f",[[UIScreen mainScreen] bounds].origin.x,[[UIScreen mainScreen] bounds].origin.y,[[UIScreen mainScreen] bounds].size.width,[[UIScreen mainScreen] bounds].size.height);

   if (IS_IPHONE) {

       if (IS_IPHONE_6_PLUS) {

           NSLog(@"IPhone 6 Plus");

       } else if (IS_IPHONE_6){

           NSLog(@"IPhone 6");

       } else if (IS_IPHONE_5){

           NSLog(@"IPhone 5/5c/5s");

       } else {

           NSLog(@"IPhone 4 或更低");

       }

   }


    本站是提供个人知识管理的网络存储空间,所有内容均由用户发布,不代表本站观点。请注意甄别内容中的联系方式、诱导购买等信息,谨防诈骗。如发现有害或侵权内容,请点击一键举报。
    转藏 分享 献花(0

    0条评论

    发表

    请遵守用户 评论公约

    类似文章 更多