方案一:
[UIView transitionWithView:[[UIApplication sharedApplication].delegate window] duration:0.4 options:UIViewAnimationOptionTransitionCrossDissolve|UIViewAnimationOptionCurveEaseInOutanimations:^{
BOOLoldState = [UIViewareAnimationsEnabled];
[UIViewsetAnimationsEnabled:NO];
[[[UIApplicationsharedApplication].delegatewindow]setRootViewController:rootLoginNav];
[UIViewsetAnimationsEnabled:oldState];
}completion:NULL
];
方案二:
CATransition *animation = [CATransition animation];
[animation setDuration:0.6];//设置动画时间
animation.type = kCATransitionFade;//设置动画类型
[[UIApplication sharedApplication].keyWindow.layer addAnimation:animation forKey:nil];
网友评论