0
我有一個iPhone 5和iPhone 4s,我正在測試一個xcode項目。我刪除了關於iPhone 5,並重新建立它在我的應用程序,現在,它識別出iPhone 5作爲iphone 4.我曾經嘗試都如何修復我的[UIScreen mainscreen]將iPhone 5識別爲iPhone 4
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone) {
NSLog(@"screen size is %f", screenSize.height);
if (screenSize.height > 480.0f) {
return TRUE;
} else {
return FALSE;
}
}
和
#define IS_WIDESCREEN (fabs((double)[ [ UIScreen mainScreen ] bounds ].size.height - (double)568) < DBL_EPSILON)
#define IS_IPHONE ([ [ [ UIDevice currentDevice ] model ] isEqualToString: @"iPhone" ])
#define IS_IPOD ([ [ [ UIDevice currentDevice ] model ] isEqualToString: @"iPod touch" ])
#define IS_IPHONE_5 (IS_IPHONE && IS_WIDESCREEN)
的問題是,不知何故[ UIScreen mainScreen] bounds.size.height正在識別我的屏幕高度爲480.00000而不是586.有沒有人遇到這個錯誤,我該如何解決它?