首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >([[UIScreen mainScreen] scale] == 2.0) & ([[UIScreen mainScreen] bounds].size.height == 568.0)不工作

([[UIScreen mainScreen] scale] == 2.0) & ([[UIScreen mainScreen] bounds].size.height == 568.0)不工作
EN

Stack Overflow用户
提问于 2014-09-29 12:59:32
回答 1查看 1.4K关注 0票数 0

由于某些原因,这将无法工作,因为我更新到最新的iOS 8的xcode。它不能识别([[UIScreen mainScreen] scale] == 2.0) &

([[UIScreen mainScreen] bounds].size.height == 568.0)

代码语言:javascript
复制
// 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");
    }
}
EN

回答 1

Stack Overflow用户

发布于 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?

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/26092803

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档