@自定义UINavigationController页面转化效果
- (void)onClickstartButton:(UIButton *)button {
CATransition *animation = [CATransition animation];
// 响应时间
animation.duration = 1.2;// 水滴效果
animation.type = @"rippleEffect";
// 决定动画的进度
animation.startProgress =0.0;
animation.endProgress =0.3;
// 下面3个可设置可不设置//animation.delegate=self;
//animation.timingFunction=UIViewAnimationCurveEaseInOut;
//animation.timingFunction = [CAMediaTimingFunction functionWithName:@"easeInEaseOut"];
[self.navigationController.view.layer addAnimation:animation forKey:nil];
HMTTestViewController * testVC = [[HMTTestViewController alloc]init];
[self.navigationController pushViewController:testVC animated:NO];
[testVC release];
}
1.#define定义的常量
@property(copy)NSString *type;(页面过渡的种类)
kCATransitionFade 交叉淡化过渡kCATransitionMoveIn 新视图移到旧视图上面
kCATransitionPush 新视图把旧视图推出去
kCATransitionReveal 将旧视图移开,显示下面的新视图
@property(copy)NSString *subtype;(页面过渡的方向)
kCATransitionFromRight
kCATransitionFromLeft
kCATransitionFromTop
kCATransitionFromBottom
2.用字符串表示
@"pageCurl " 向上翻一页
@"pageUnCurl" 向下翻一页
@"rippleEffect" 滴水(波纹)效果
@"suckEffect" 收缩效果,如一块布被抽走或者是被吸收
@"cube" 立方体效果
@"oglFlip" 上下翻转效果
@"cameraIrisHollowOpen" 镜头开效果
@"cameraIrisHollowClose" 镜头关效果