ios fade out splash screen (iphone 5 friendly)

前端 未结 4 691
梦谈多话
梦谈多话 2020-12-16 05:29

I\'m wanting to spoof the feel of the main splash screen fading out whenever applicationDidBecomeActive is called, but it\'s not working. What am I doing wrong?

4条回答
  •  自闭症患者
    2020-12-16 05:59

    I find, from ios6 you get a nice transition doing this

    -(BOOL)application:(UIApplication *)application willFinishLaunchingWithOptions:(NSDictionary *)launchOptions
    {
        [UIView animateWithDuration:0.2
                              delay:0
                            options: UIViewAnimationCurveEaseIn
                         animations:^{
                            self.window.viewForBaselineLayout.alpha = 0; // and at this alpha
                         }
                         completion:^(BOOL finished){
                         }];
    
        return YES;
    }
    

    then immediately at the start of

    - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
    {
    
        [UIView animateWithDuration:0.5
                              delay:0
                              options: UIViewAnimationCurveEaseOut
                          animations:^{
                             self.window.viewForBaselineLayout.alpha = 1; // and at this alpha
                         }
                         completion:^(BOOL finished){
                         }];
    

    It gives a cross fadeish effect from the loading screen to the now loaded app screen.

提交回复
热议问题