淡入淡出效果

作者: 学习ing兰 | 来源:发表于2017-03-30 10:31 被阅读31次

跳转代码

SearchViewController* searchVC = [[SearchViewControlleralloc]init];

CATransition*animation= [CATransitionanimation];

animation.timingFunction=UIViewAnimationCurveEaseInOut;

animation.type=@"Fade";

animation.duration=.3f;

animation.subtype=kCATransitionFromRight;

[[UIApplicationsharedApplication].keyWindow.layeraddAnimation:animationforKey:nil];

UINavigationController*nav = [[UINavigationControlleralloc]initWithRootViewController:searchVC];

[self.navigationControllerpresentViewController:navanimated:NOcompletion:nil];```
返回代码

__weaktypeof(self) weakSelf =self;

[UIViewanimateWithDuration:.3animations:^{

weakSelf.view.alpha=0;

}completion:^(BOOLfinished) {

[weakSelf.navigationControllerdismissViewControllerAnimated:NOcompletion:nil];

}];```

相关文章

网友评论

    本文标题:淡入淡出效果

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