2013-10-28 64 views
-4

现在我正在使用Xcode 5创建应用程序。我的问题与启动图像有关。 我的问题是,当应用程序突然启动时会出现黑屏,然后启动屏幕(Aditional viewcontroller用于闪屏)平稳加载。 我已经设置了default.png(320 * 480)作为启动图像。在Xcode 4.5中,它工作的很完美。我不是为什么当应用程序启动时出现黑屏而不是default.png。我错过了什么?为Xcode 5启动图像

...高级谢谢...

这是我的代码使用spashviewController:

Appdelegate *appdelegate=(Appdelegate*)[[UIApplication sharedApplication] delegate]; 
int ht=[UIScreen mainScreen].bounds.size.height; 
////NSLog(@"ht is %d",ht); 
[self.view setFrame:CGRectMake(0, 71, 320,ht-64)]; 
if(appdelegate.window.frame.size.height==568) 
{ 
    // code for 4-inch screen 
    ////NSLog(@"iPhone 5 Screen"); 
    ////NSLog(@"main view nd main image view is resizable so noo need to set frame,just change the the image of main image view"); 
    backgroundimage.image=[UIImage imageNamed:@"[email protected]"]; 
    activityIndicator.frame=CGRectMake(141,476,20,10); 

} else { 
    backgroundimage.image=[UIImage imageNamed:@"default.png"]; 
} 
+0

请格式化您的代码。 – Popeye

回答

1

启动时没有任何与你写任何代码有一个黑色的屏幕 - 它总是意味着你没有以正确的方式定义默认图像。

尝试使用资产目录作为您的启动图像,并设置所有必需的默认图像 - 如果它只是iPhone,则为320x480,640x960和640x1136。

您可以通过在项目 - >常规页面中单击使用资产目录来创建资产目录。