Smooth transition from launch image to main view

前端 未结 4 1275
伪装坚强ぢ
伪装坚强ぢ 2020-12-13 22:40

Is it possible to implement a smooth transition when the app loads, from the launch image to the first view?

The default behavior is on/off, with an immediate change

4条回答
  •  借酒劲吻你
    2020-12-13 23:05

    You are in luck. I just did this a few min ago. You need a splash screen. An image on your view that is exactly the same as your default image that the device loads. Then in your app have it dismiss with a fade animation called from the viewDidAppear function

    - (void)viewDidAppear:(BOOL)animated
    {
        [super viewDidAppear:animated];
        [self performSelector:@selector(killSplashScreen) withObject:nil afterDelay:1.0];
    
    }
    
    - (void)killSplashScreen {
        [UIView animateWithDuration:0.5 animations:^{splashScreen.alpha = 0.0;} completion:NULL];
    }
    

提交回复
热议问题