在splashscreen之后显示下一个视图

时间:2013-01-08 10:02:10

标签: iphone objective-c ios cocoa-touch

我想在iphone启动的默认启动视图后加载我选择的视图。有人知道如何实现这一目标吗?我是xcode和ios开发的新手。

3 个答案:

答案 0 :(得分:0)

Github上有一个名为LaunchImageTransition的项目,它应该在加载Default.png图像后提供自定义视图。

答案 1 :(得分:0)

[self setUpSplash];方法中添加- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions方法。并在 AppDelegate.m

中添加以下方法
-(void) setUpSplash {
    self.splashImgView = [[UIImageView alloc] initWithFrame:[[UIScreen mainScreen] applicationFrame]];
    [self.splashImgView setImage: [UIImage imageNamed:@"splash.png"]];
    [self.window addSubview: self.splashImgView];

    [NSTimer scheduledTimerWithTimeInterval:2.0f target:self selector:@selector(closeSplashWithTimer:) userInfo:nil repeats:NO];
}

- (void)closeSplashWithTimer:(NSTimer *)theTimer
{
    [UIView beginAnimations:@"ToggleViews" context:nil];
    [UIView setAnimationDuration:1.0];

    // Make the animatable changes.
    splashImgView.alpha = 0.0;
    self.mvNavigationController.view.alpha = 1.0;

    // Commit the changes and perform the animation.
    [UIView commitAnimations];

    [NSTimer scheduledTimerWithTimeInterval:2.0f target:self selector:@selector(closeSplashWithTimerAgain:) userInfo:nil repeats:NO];
}

- (void)closeSplashWithTimerAgain:(NSTimer *)theTimer
{
    [self.splashImgView removeFromSuperview];
}

答案 2 :(得分:0)

请检查这个项目 https://github.com/QuickBlox/ChattAR-ios

默认情况下,飞溅消失后,使用自定义启动画面。