可能重复:
How to develop or migrate apps for iPhone 5 screen resolution?
当我附上一张图片时,我已经在XIB中为iPhone-5屏幕尺寸生成了视图。当我在iPhone5屏幕上运行iPhone-4s视网膜时,但它会在iPhone-4s屏幕的模拟器中显示。
我已经使用屏幕尺寸属性自动完成了所有尺寸设置。
实际上没有达到状态栏问题。 如果屏幕与大屏幕不兼容,那么状态栏也应该在顶部。但为什么它在中间如此显示?
有人能告诉我这个问题的解决方案吗?
提前致谢。
答案 0 :(得分:2)
您可以将启动图像添加到名为 Default-568h@2x.png
的项目中这将以全屏显示您的布局,而不是在中间显示。
答案 1 :(得分:0)
在Didfinishlaunching方法中的App委托类中设置它:
[[UIApplication sharedApplication] setStatusBarHidden:YES animated:YES];
答案 2 :(得分:0)
我早些时候成功了。
在AppDelegate和[[UIApplication sharedApplication] setStatusBarHidden:NO];
文件集属性.plist
中将Statusbar is initially hidden
写入YES
。
希望这会对你有所帮助.... :)
答案 3 :(得分:-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!");
}
干杯!