当我在 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 一样运行,请检查图像以获取更多描述。
正如您所看到的顶部和底部黑色。我该如何解决这个问题
最佳答案
设置 iPhone 5 启动屏幕。它将被修复。
iPhone 5 启动屏幕规范:640x1136
暂时在 photoshop 或预览中创建一个空白屏幕。您可以稍后更换它。
关于ios - 当我在 iphone 5 屏幕上运行程序时 xcode 看起来像 iphone 4,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26546641/