可能是重复问题:
如何检测iPhone 5(宽屏设备)?
我正在尝试在现有的iOS4项目中添加一个新视图以处理新的iPhone5屏幕尺寸。
然而,我没有iPhone可以测试,并且我用于测试屏幕尺寸的代码不起作用,想知道是否有另一种检测设备类型的方法?
NSLog(@"%f", [ [ UIScreen mainScreen ] bounds ].size.height);
if([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone){
if([UIScreen mainScreen].bounds.size.height == 568.0)
{
//move to your iphone5 storyboard
[self changeView:splashScreenBIGV viewH:splashScreenH animLength:SCREEN_CHANGE_ANIM_LENGTH];
}
else{
//move to your iphone4s storyboard
[self changeView:splashScreenV viewH:splashScreenH animLength:SCREEN_CHANGE_ANIM_LENGTH];
}
}