UINavigationController自定义,push和pop动画
来源:互联网 发布:2017即将上映的网络剧 编辑:程序博客网 时间:2024/05/14 15:40
我自己写的一个自定义UINavigationController,可以很方便地定制UINavigationController的navigationBar背景样式,比较炫的push和pop效果,不多说,上代码。
重写-(void)pushViewController:(UIViewController *)viewController animated:(BOOL)animated方法,以下是动画的关键代码
UIView * toView = [viewControllerview];
CABasicAnimation *Animation = [CABasicAnimationanimationWithKeyPath:@"transform"];
CATransform3D rotationAndPerspectiveTransform =CATransform3DIdentity;
rotationAndPerspectiveTransform.m34 =1.0 / -1000;
rotationAndPerspectiveTransform =CATransform3DMakeTranslation(self.view.frame.size.width,0,0);
[Animation setFromValue:[NSValuevalueWithCATransform3D:CATransform3DMakeTranslation(self.view.bounds.size.width,0,0)]];
[Animation setToValue:[NSValuevalueWithCATransform3D:CATransform3DMakeTranslation(0,0,0)]];
[AnimationsetDuration:0.3];
Animation.delegate =self;
//no表示动画会保持最后的状态,yes会返回到最初的状态
Animation.removedOnCompletion =NO;
Animation.fillMode =kCAFillModeBoth;
[toView.layeraddAnimation:AnimationforKey:@"fromRight"];
CABasicAnimation *Animation1 = [CABasicAnimationanimationWithKeyPath:@"transform"];
CATransform3D rotationAndPerspectiveTransform1 =CATransform3DIdentity;
rotationAndPerspectiveTransform1.m34 =1.0 / -1000;
rotationAndPerspectiveTransform1 =CATransform3DMakeScale(1.0,1.0,1.0);
[Animation1 setToValue:[NSValuevalueWithCATransform3D:CATransform3DMakeScale(0.95,0.95,0.95)]];
[Animation1setDuration:0.3];
Animation1.delegate =self;
Animation1.removedOnCompletion =NO;
Animation1.fillMode =kCAFillModeBoth;
[animationLayeraddAnimation:Animation1forKey:@"scale"];
相关项目代码例子:http://download.csdn.net/detail/a865499908/7041469
- UINavigationController自定义,push和pop动画
- UINavigationController自定义,push和pop动画
- swift详解之二十七------------自定义UINavigationController的push和pop动画
- IOS 自定义push和pop动画
- 自定义Push和Pop过渡动画
- NavigationController 自定义pop和push动画
- 自定义PUSH POP跳转动画
- 自定义NavigationController 的Push 和 Pop过渡动画
- Swift基础之自定义PUSH和POP跳转动画
- iOS 自定义动画 push/pop动画
- 自定义导航栏pop动画(push同理)
- UINavigationController先pop再push
- navigationController push和pop界面切换动画
- 定义NavigationController pop 和push的动画
- UINavigationController Push动画
- IOS UINavigationController Push 动画
- 【iOS学习笔记 15-11-06】简单自定义navigationcontroller push和pop动画效果
- ios push pop动画
- share SDK
- $ajax
- shell
- 水平居中,垂直居中
- 学习笔记 --- LINUX块设备驱动框架分析
- UINavigationController自定义,push和pop动画
- ZOJ(1649)Rescue
- hdu(4339)树状数组+二分查找
- PHP/EclipsePHP代码自动提示
- poj(2185) Milking Grid (很好的kmp题目)
- 【C解析之四】指针
- 1504: ZZ的橱柜(长沙理工oj)
- hdu (2852) KiKi's K-Number
- csust 1467: 数学(扩展欧几里得)