两个ViewController之间跳转的动画效果
2013-02-19 10:49
375 查看
两个ViewController之间跳转的动画效果
进入SecondeViewController:
SecondViewCotroller *secondViewController = [[SecondViewCotrolleralloc]
init];
[UIViewbeginAnimations:nilcontext:NULL];
[UIViewsetAnimationCurve:UIViewAnimationCurveEaseOut];
[UIViewsetAnimationDuration:1.0f];
[self.navigationControllerpushViewController:secondViewController
animated:YES];
[UIViewcommitAnimations];
返回到FirstViewController:
CATransition *animation = [CATransitionanimation];
animation.duration =
1.0f;
//slow at beginning and end
animation.timingFunction =
UIViewAnimationCurveEaseInOut;
animation.type =
@"cube";
//从右向左
[animation setSubtype:kCATransitionFromRight];
[self.navigationController.view.layeraddAnimation:animation
forKey:@"animation"];
[self.navigationControllerpopViewControllerAnimated:YES];
进入SecondeViewController:
SecondViewCotroller *secondViewController = [[SecondViewCotrolleralloc]
init];
[UIViewbeginAnimations:nilcontext:NULL];
[UIViewsetAnimationCurve:UIViewAnimationCurveEaseOut];
[UIViewsetAnimationDuration:1.0f];
[self.navigationControllerpushViewController:secondViewController
animated:YES];
[UIViewcommitAnimations];
返回到FirstViewController:
CATransition *animation = [CATransitionanimation];
animation.duration =
1.0f;
//slow at beginning and end
animation.timingFunction =
UIViewAnimationCurveEaseInOut;
animation.type =
@"cube";
//从右向左
[animation setSubtype:kCATransitionFromRight];
[self.navigationController.view.layeraddAnimation:animation
forKey:@"animation"];
[self.navigationControllerpopViewControllerAnimated:YES];
相关文章推荐
- ViewController之间跳转动画效果
- 如何实现两个ViewController视图之间的透明效果
- 两个UIViewController之间的翻转可以用动画效果翻转(上下,左右)--跨界面之间的视图切换
- presentModalViewController方法,present一个透明的viewController,带动画效果
- 手势检测实现相册的左右滑动(并加上移动与旋转的特效) 首先,activity_main.xml里,使用ViewFlipper组件(可使用动画控制多个组件之间的切换效果) <?xml version="
- iOS pushViewController 实现push 和pop 默认动画效果
- ios开发中viewcontroller之间的跳转
- overridePendingTransition设定两个activity之间的转场动画没有效果,但不报错! (大神帮帮我吧,代码如下,谢谢)
- ViewController之间的切换动画
- iOS7 pushViewController 动画效果卡顿
- NSNotification解决view和controller之间的跳转耦合问题
- 如何在两个ViewController之间传递数据
- View动画另一些使用场景--LayoutAnimation和Activity之间的切换效果
- 用动画效果实现两个activity之间切换
- 自定义ModalViewController 动画效果
- 效果器(两个动画之间的效果)
- Android 两个activity之间“平推”的动画切换效果
- 学习笔记--两个UIView之间跳转、tag,UIAlertView基本使用
- 更改pushViewController和popViewController的动画效果
- IOS开动画效果之──实现 pushViewController 默认动画效果