我想通过编程方式创建启动画面。
但它没有显示启动画面。
请参考以下代码:
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
// Override point for customization after application launch.
UIImage *aSplashImage = [UIImage imageNamed:@"Splash.jpeg"];
UIImageView *aSplashImageView = [[UIImageView alloc] initWithFrame:self.window.frame];
aSplashImageView.image = aSplashImage;
UIView *aSplashView = [[UIView alloc]initWithFrame:self.window.frame];
[aSplashView addSubview:aSplashImageView];
[self.window addSubview:aSplashView];
return YES;
}
答案 0 :(得分:0)
我想说只是在窗口中添加UIView
就足够了,窗口已经包含UIViewController
。也许你的UIView
将落后于它。
这篇文章提供了一些如何创建启动画面的指示:Show a view as a splash screen in didFinishLaunchingWithOptions
答案 1 :(得分:0)
就像@KunalBalani在评论中所说的那样,以下question很可能就是你要找的东西;)