1

可能重复:
如何为 iPhone 5 屏幕分辨率开发或迁移应用程序?

布局问题

在附加图像时,我在 XIB 中为 iPhone-5 屏幕尺寸生成了视图。当我将作为 iPhone5 屏幕的 iPhone-4s 视网膜运行时,它会在 iPhone-4s 屏幕的模拟器中显示为这样。

我已经使用屏幕尺寸属性完成了所有尺寸设置自动。

实际上没有解决状态栏问题。如果屏幕不兼容大屏幕,那么状态栏也应该在顶部。但是为什么中间这么显眼呢?

谁能尽快告诉我这个问题的解决方案?

提前致谢。

4

4 回答 4

2

您可以将启动图像添加到名为Default-568h@2x.png的项目中

这将全屏显示您的布局,而不是在中间显示。

于 2012-12-28T08:19:50.627 回答
0

我之前在这方面取得了成功。

[[UIApplication sharedApplication] setStatusBarHidden:NO];在 AppDelegate 和.plist文件集属性Statusbar is initially hidden中写入YES.

希望对你有帮助....:)

于 2012-12-28T06:58:27.237 回答
0

在 Didfinishlaunching 方法的 App 委托类中设置此项:

[[UIApplication sharedApplication] setStatusBarHidden:YES animated:YES];
于 2012-12-28T06:44:12.273 回答
-1

您可以检查设备屏幕兼容性如下:

//Device Compatibility
#define g_IS_IPHONE             ( [[[UIDevice currentDevice] model] isEqualToString:@"iPhone"] )
#define g_IS_IPOD               ( [[[UIDevice currentDevice] model] isEqualToString:@"iPod touch"] )
#define g_IS_IPAD               ( [[[UIDevice currentDevice] model] isEqualToString:@"iPad"] )
#define g_IS_IPHONE_5_SCREEN    [[UIScreen mainScreen] bounds].size.height >= 568.0f && [[UIScreen mainScreen] bounds].size.height < 1024.0f
#define g_IS_IPHONE_4_SCREEN    [[UIScreen mainScreen] bounds].size.height >= 480.0f && [[UIScreen mainScreen] bounds].size.height < 568.0f


if(g_IS_IPHONE_5_SCREEN)
{
    if(g_IS_IPHONE)
        NSLog(@"Hey, this is an iPhone 5 screen!");
    else if(g_IS_IPOD)
        NSLog(@"Hey, this is an iPod 5 screen!");
    else
        NSLog(@"Hey, this is a simulator screen with iPhone 5 screen height!");
}
else if(g_IS_IPHONE_4_SCREEN)
{
    if(g_IS_IPHONE)
        NSLog(@"Hey, this is a lower iPhone screen than 5!");
    else if(g_IS_IPOD)
        NSLog(@"Hey, this is a lower iPod screen than 5!");
    else
        NSLog(@"Hey, this is a lower simulator screen than 5!");
}
else if(g_IS_IPAD){
    NSLog(@"Hey, this is an iPad screen!");
}
else{
    NSLog(@"Hey, this is an ipad simulator screen!");
}

干杯!

于 2012-12-28T07:55:06.073 回答