如何判断iphone4、iphone4s、iphone5、iPad、iPad retina

if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) { CGFloat scale = [[UIScreen mainScreen] scale]; if (scale > 1.0) { //iPad retina screen } else { //iPad screen } } else { if ([UIScreen instancesRespondToSelector:@selector(scale)]) { CGFloat scale = [[UIScreen mainScreen] scale]; if (scale > 1.0) { if([[ UIScreen mainScreen ] bounds ].size.height == 568) { //iphone 5 } else { //iphone retina screen } } else { //iphone screen } } }

你可能感兴趣的:(ipad,ipad,iphone4,iphone4s,iPhone5,retina)