更改pushViewController和popViewController的动画效果(转)
来源:互联网 发布:2017电视机出口数据 编辑:程序博客网 时间:2024/06/05 00:58
iPhone SDK的NavigationController提供的动画效果默认只有一种,如何实现各种不同的呢?
下面是来自three20的实现,大家只要把这两个方法作为UINavigationController的Category方法调用就可以了
- (void)pushAnimationDidStop {
}
- (void)pushViewController: (UIViewController*)controller
animatedWithTransition: (UIViewAnimationTransition)transition {
[self pushViewController:controller animated:NO];
[UIView beginAnimations:nil context:nil];
[UIView setAnimationDuration:0.75f];
[UIView setAnimationDelegate:self];
[UIView setAnimationDidStopSelector:@selector(pushAnimationDidStop)];
[UIView setAnimationTransition:transition forView:self.view cache:YES];
[UIView commitAnimations];
}
- (UIViewController*)popViewControllerAnimatedWithTransition:(UIViewAnimationTransition)transition {
UIViewController* poppedController = [self popViewControllerAnimated:NO];
[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDuration:0.75f];
[UIView setAnimationDelegate:self];
[UIView setAnimationDidStopSelector:@selector(pushAnimationDidStop)];
[UIView setAnimationTransition:transition forView:self.view cache:NO];
[UIView commitAnimations];
return poppedController;
}
下面是来自three20的实现,大家只要把这两个方法作为UINavigationController的Category方法调用就可以了
- (void)pushAnimationDidStop {
}
- (void)pushViewController: (UIViewController*)controller
animatedWithTransition: (UIViewAnimationTransition)transition {
[self pushViewController:controller animated:NO];
[UIView beginAnimations:nil context:nil];
[UIView setAnimationDuration:0.75f];
[UIView setAnimationDelegate:self];
[UIView setAnimationDidStopSelector:@selector(pushAnimationDidStop)];
[UIView setAnimationTransition:transition forView:self.view cache:YES];
[UIView commitAnimations];
}
- (UIViewController*)popViewControllerAnimatedWithTransition:(UIViewAnimationTransition)transition {
UIViewController* poppedController = [self popViewControllerAnimated:NO];
[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDuration:0.75f];
[UIView setAnimationDelegate:self];
[UIView setAnimationDidStopSelector:@selector(pushAnimationDidStop)];
[UIView setAnimationTransition:transition forView:self.view cache:NO];
[UIView commitAnimations];
return poppedController;
}
0 0
- 更改pushViewController和popViewController的动画效果
- 更改pushViewController和popViewController的动画效果
- 更改pushViewController和popViewController的动画效果
- 更改pushViewController和popViewController的动画效果
- 更改pushViewController和popViewController的动画效果(转)
- 改变navigationController pushViewController 和popViewController动画
- iOS pushViewController 实现push 和pop 默认动画效果
- 【转】自定义presentviewcontroller和pushviewcontroller转场动画
- pushViewController 动画效果卡顿
- 自定义 pushViewController 的动画
- pushViewController自定义动画(转)
- pushViewController自定义动画(转)
- 更改frame的动画效果
- iOS7 pushViewController 动画效果卡顿
- iOS7 pushViewController 动画效果卡顿
- pushviewcontroller popviewcontroller presentationController dismissViewController 配套问题
- IOS开动画效果之──实现 pushViewController 默认动画效果(转)
- pushViewController 动画
- 又是防火墙
- 前端节流
- Android View.onMeasure方法的理解
- 黑马程序员_毕向东_Java基础视频教程第01天
- 用户模式下线程同步
- 更改pushViewController和popViewController的动画效果(转)
- Android启用GPRS成功后反馈流程(MTK)
- Hibernate继承映射
- web服务器集群(多台web服务器)session同步、共享的3种解决方法
- J2EE之JNDI
- 我的算法之路
- Spring security初探
- Android好奇宝宝_12_社会化分享那些事
- 几种排序算法