码迷,mamicode.com
首页 > 移动开发 > 详细

判断iOS6/iOS7, 3.5inch/4.0inch

时间:2014-08-23 16:50:11      阅读:193      评论:0      收藏:0      [点我收藏+]

标签:ios


Retina (3.5/4 inch Screen) or Non-Retina 判断


if ([[UIScreen mainScreen] respondsToSelector:@selector(scale)]) {
    if ([[UIScreen mainScreen] scale] == 2.0) {
       if([UIScreen mainScreen].bounds.size.height == 568){
          // iPhone retina-4 inch
        } else{
         // iPhone retina-3.5 inch
        }
}
else {
    // not retina display
}

iOS6/iOS7 判断


NSString *ver = [[UIDevice currentDevice] systemVersion];
 float ver_float = [ver floatValue];
 if (ver_float >= 7.0)
 {
    //iOS >=7
 }
 else{
    //iOS <7
  }



判断iOS6/iOS7, 3.5inch/4.0inch

标签:ios

原文地址:http://blog.csdn.net/sirodeng/article/details/38779295

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!