判断iOS6/iOS7, 3.5inch/4.0inch


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

上一篇:jquery的clone方法bug的修复


下一篇:详解Android中AsyncTask的使用