比量iOS6/iOS7, 3.5inch/4.0inch


Retina (3.5/4 inch Screen) or Non-Retina 比量code


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 推斷blog


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



版權聲明:本文博主原創文章,博客,未經贊成不得轉載。ip

相關文章
相關標籤/搜索