Loading a Welcome Screen (Splash Screen) before TabBarController

后端 未结 5 1426
不知归路
不知归路 2020-12-08 09:11

In my TabBar based iPhone application, I would like to display a full screen welcome page (with some logs) before the actual application loads, How can I load a UIView from

5条回答
  •  囚心锁ツ
    2020-12-08 09:28

    - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 
    {    
        splashView=[[UIImageView alloc]initWithImage:[UIImage imageNamed:@"image01.png"]];
        splashView.frame=CGRectMake(0,21,320,460);
        [self.window makeKeyAndVisible];
        [self.window addSubview:splashView];
    
    
        [self performSelector:@selector(splashremove) withObject:nil afterDelay:10.5];
        [self performSelector:@selector(sixthimage) withObject:nil afterDelay:9.0];
        [self performSelector:@selector(fifthimage) withObject:nil afterDelay:7.5];
        [self performSelector:@selector(fourthimage) withObject:nil afterDelay:6.0];
        [self performSelector:@selector(thirdimage) withObject:nil afterDelay:4.5];
        [self performSelector:@selector(secondimage) withObject:nil afterDelay:3.0];
        [self performSelector:@selector(firstimage) withObject:nil afterDelay:1.5];
    
    
       return YES;
    }
    
    -(void)firstimage
    {
        NSLog(@"Inside first image");
        splashView.image=[UIImage imageNamed:@"image01.png"];
    }
    
    
    -(void)secondimage
    {
        NSLog(@"Inside second image");
        splashView.image=[UIImage imageNamed:@"image02.png"];
    }
    
    
    
    -(void)thirdimage
    {
        NSLog(@"Inside third image");
        splashView.image=[UIImage imageNamed:@"image03.png"];
    }
    
    
    
    -(void)fourthimage
    {
        NSLog(@"Inside fourth image");
        splashView.image=[UIImage imageNamed:@"image04.png"];
    }
    
    
    
    -(void)fifthimage
    {
        NSLog(@"Inside fifth image");
        splashView.image=[UIImage imageNamed:@"image05.png"];
    }
    
    
    
    -(void)sixthimage
    {
        NSLog(@"Inside sixth image");
        splashView.image=[UIImage imageNamed:@"image06.png"];
    
    
    }
    
    -(void)splashremove
    {
        NSLog(@"Inside splashremove image");
    
        [splashView removeFromSuperview];
        [splashView release];
    
        [self.window addSubview:tabBarController.view];
        [self.window makeKeyAndVisible];
    
    }
    

提交回复
热议问题