【发布时间】:2012-12-26 08:45:41
【问题描述】:
我在 3.5 英寸屏幕上开发了一个应用程序,现在我为 4 英寸屏幕做了一个新的故事板,我喜欢在 appdelegate 上的故事板之间切换,我记录了屏幕高度,它给了我 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
【问题讨论】:
-
你有 568px 高的启动图片(Default.png)吗?否则,您将不会以全屏模式启动。
-
我现在就试试。并回复你。感谢您的帮助:D
-
感谢它的工作:D +1