我已经在3.5英寸的屏幕上开发了一个应用程序,现在我为4英寸的屏幕做了一个新的故事板,我喜欢在应用程序代表上的故事板之间切换,我记录了屏幕高度,它会给我480.00000检查:
NSLog(@"Checking Screen Size");
if ([UIDevice currentDevice].userInterfaceIdiom == UIUserInterfaceIdiomPhone)
{
NSLog(@"On iPhone");
CGSize iOSDeviceScreenSize = [[UIScreen mainScreen] bounds].size;
if (iOSDeviceScreenSize.height == 480)
{ (diagonally measured)
NSLog(@"iPhone 4: %f", iOSDeviceScreenSize.height);
}
if (iOSDeviceScreenSize.height == 568)
{
NSLog(@"iPhone 5: %f", iOSDeviceScreenSize.height);
}当我的手机是iPhone 5时,NSLog会给我480.0000
发布于 2012-12-26 16:53:24
你需要在应用程序中添加一个“高大的”启动图像Default-568h@2x.png,以表明你支持新的显示尺寸,否则你将在兼容模式下运行(而不是全屏)。
发布于 2012-12-26 16:52:01
您应该向项目中添加一个新的默认图像Default-568h@2x.png。
发布于 2012-12-26 16:53:46
这非常简单,只需将iPhone 5的默认图像Default-568h@2x.png添加到项目中即可。
https://stackoverflow.com/questions/14038077
复制相似问题