美文网首页常看
iOS修改根视图控制器动画

iOS修改根视图控制器动画

作者: oneDemo | 来源:发表于2016-07-05 15:45 被阅读980次

    方案一:

    [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];

    相关文章

      网友评论

        本文标题:iOS修改根视图控制器动画

        本文链接:https://www.haomeiwen.com/subject/oqihjttx.html