Displaying next view after splashscreen

你说的曾经没有我的故事 提交于 2019-12-24 20:19:25

问题


I want to load a view of my choice after the default splash view of iphone launches. Does someone know how to achieve this ? i am new to xcode and ios development.


回答1:


There is a project at Github called LaunchImageTransition, it should provide a custom view after the Default.png image has been loaded.




回答2:


Please, check this project https://github.com/QuickBlox/ChattAR-ios

Here uses custom splash screen after default splash disappeared.




回答3:


Add [self setUpSplash]; method in - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions method. And add following Three method in 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];
}


来源:https://stackoverflow.com/questions/14212431/displaying-next-view-after-splashscreen

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!