Possible Duplicate:
How to detect iPhone 5 (widescreen devices)?
我们可以使用以下方式区分iPad和iPhone
UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone/UIUserInterfaceIdiomPad
最佳答案
引用this post:
#define IS_IPHONE_5 ( fabs( ( double )[ [ UIScreen mainScreen ] bounds ].size.height - ( double )568 ) < DBL_EPSILON )
if( IS_IPHONE_5 )
{}
else
{}
if ([UIDevice currentDevice].userInterfaceIdiom == UIUserInterfaceIdiomPhone) {
if ([[UIScreen mainScreen] bounds].size.height == 568) {
//5
}else{
//not 5
}
}else{
//iPad
}
关于iphone - iPhone 4,iPhone 5和iPad在用户界面方面有所区别,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/12890408/