ios - 当我在 iphone 5 屏幕上运行程序时 xcode 看起来像 iphone 4

标签 ios objective-c iphone xcode

当我在 iOS 8 (iPhone 5) 上测试程序时,我使用 Xcode 6 并使用 objective-c 程序运行没有错误,但是当我尝试在 iOS 7 (iPhone 5) 上测试程序时,屏幕看起来像 iPhone 4 屏幕。我可以这样检测手机;

#define iPhone6Plus ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone && [UIScreen mainScreen].bounds.size.height == 736)
#define iPhone6 ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone && [UIScreen mainScreen].bounds.size.height == 667)
#define IS_IPHONE_5 ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone && [UIScreen mainScreen].bounds.size.height == 568)
#define IS_IPAD UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad

而且我还能像这样检测操作系统;

if (floor(NSFoundationVersionNumber) <= NSFoundationVersionNumber_iOS_7_0)
{
    #define IS_IPHONE_5 ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone && [UIScreen mainScreen].bounds.size.height == 568)
}

当我执行此屏幕时,无法在手机上缩放,因为当我在 iOS 7 手机屏幕上运行时,手机屏幕会像 iPhone 4 一样运行,请检查图像以获取更多描述。 enter image description here

正如您所看到的顶部和底部黑色。我该如何解决这个问题

最佳答案

enter image description here

设置 iPhone 5 启动屏幕。它将被修复。

iPhone 5 启动屏幕规范:640x1136

暂时在 photoshop 或预览中创建一个空白屏幕。您可以稍后更换它。

关于ios - 当我在 iphone 5 屏幕上运行程序时 xcode 看起来像 iphone 4,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26546641/

相关文章:

ios - UITableView 项目有时会在选择时消失(取决于屏幕尺寸)

ios - OS X Server + GIT 与 SSH 的集成失败并出现权限被拒绝错误

iphone - 将 iPhone 时间与服务器同步的最佳方法

ios - 关于如何同时为不同的 UIView 设置动画的方法

ios - 如何在 Swift 中循环 JSON 对象?

ios - UIApplicationDelegate 在 Swift 应用程序中没有名为 managedObjectContext 的成员

ios - 使用 Objective-C 计算年龄

objective-c - Objective-C 中的 id 指针

objective-c - iOS -> setNavigationBarHidden 延迟

ios - Instagram : Access token validity