RootViewController切换过渡动画 [英] RootViewController Switch Transition Animation

查看:300
本文介绍了RootViewController切换过渡动画的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有什么方法可以有一个过渡/动画效果,而替换一个现有的视图控制器作为rootviewcontroller与一个新的appDelegate?

Is there any way to have a Transition/animation effect while replacing an existing viewcontroller as rootviewcontroller with a new one in the appDelegate?

推荐答案

当然。只需在转换块中换行 rootViewController

Sure. Just wrap the switching of the rootViewController in a transition block:

[UIView transitionWithView:self.window
                  duration:0.5
                   options:UIViewAnimationOptionTransitionFlipFromLeft
                animations:^{ self.window.rootViewController = newViewController; }
                completion:nil];

这篇关于RootViewController切换过渡动画的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆