我想在我的应用程序中添加启动画面。我在下面写代码。它在 ios 模拟器中可见,但在设备中不可见。任何建议
UIImageview *splashView = [[UIImageView alloc] initWithFrame:CGRectMake(0,0, 320, 460)];
splashView.image = [UIImage imageNamed:@"default1.png"];
[self.window addSubview:splashView];
[self.window bringSubviewToFront:splashView];
[UIView beginAnimations:nil context:nil];
[UIView setAnimationDuration:5.0];
[UIView setAnimationTransition:UIViewAnimationTransitionNone forView:self.window cache:YES];
[UIView setAnimationDelegate:self];
[UIView setAnimationDidStopSelector:@selector(finishAnimation)];
splashView.alpha = 0.0;
[UIView commitAnimations];
...
-(void)finishAnimation
{
[splashView removeFromSuperview];
self.window.rootViewController =self.navcontroller;
}
直接可见登录页面