由于某些原因,这将无法工作,因为我更新到最新的iOS 8的xcode。它不能识别([[UIScreen mainScreen] scale] == 2.0) &
([[UIScreen mainScreen] bounds].size.height == 568.0)
// Indicates game is running on iPad
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) {
CCLOG(@"Running on iPad");
// it doesn´t recognize this any more
if ([[UIScreen mainScreen] scale] == 2.0) {
CCLOG(@"Running on iPad Retina");
} else {
CCLOG(@"Running on iPad 2");
}
} else {
CCLOG(@"Running on iPhone");
// it doesn´t recognize this any more
if ([[UIScreen mainScreen] bounds].size.height == 568.0) {
CCLOG(@"Running on iPhone 5");
} else {
CCLOG(@"Running on iPhone 4/4S");
}
}发布于 2014-09-30 13:41:48
您需要添加对iPhone 5的支持。为此,您需要将名为Default-568h@2x.png的启动镜像添加到您的项目中。如果没有此图像,iOS将在兼容模式下运行应用程序,即高度= 468
这个问题在前面的其他问题中已经提过了。
how-to-add-iphone-5-large-screen-support-to-ios-apps-in-xcode
How to develop or migrate apps for iPhone 5 screen resolution?
https://stackoverflow.com/questions/26092803
复制相似问题