IOS第18天(8,核心动画转场动画)
2015-09-06 17:30
387 查看
***翻页效果
#import "HMViewController.h" @interface HMViewController () @property (weak, nonatomic) IBOutlet UIImageView *imageView; @property (nonatomic, assign) int index; @end @implementation HMViewController - (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view, typically from a nib. _index = 1; } - (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event { _index++; if (_index == 4) { _index = 1; } NSString *fileName = [NSString stringWithFormat:@"%d",_index]; _imageView.image = [UIImage imageNamed:fileName]; CATransition *anim = [CATransition animation]; anim.type = @"pageCurl"; anim.subtype = kCATransitionFromLeft; // anim.startProgress = 0.5; anim.duration = 2; [_imageView.layer addAnimation:anim forKey:nil]; } @end
相关文章推荐
- IOS第18天(7,CAKeyframeAnimation-图标抖动)
- IOS第18天(6,CAKeyframeAnimation关键帧动画)
- IOS第18天(5,CABasicAnimation基本动画)
- iOS 链式函数使用
- IOS第18天(4,核心动画,时钟效果,定时器,图片旋转角度,CALayer 锚点,获取当前,小时,秒,分)
- ios 即时通讯-xmpp
- iOS中.gitignore的使用
- IOS第18天(3,CALayer隐式动画)
- IOS第18天(2,CALayer自定义图层)
- iOS 清除缓存
- IOS第18天(1,核心动画layer, 旋转,缩放,平移,边框,剪裁,圆角)
- ios开发通知与消息机制
- ios开发——手势
- ios xml解析
- iOS的过渡动画
- iOS 8 Xcode6 设置Launch Image 启动图片<转>
- SDWebImage的使用
- iOS学习之创建多个子工程
- IOS第三方代码收集
- iOS 网易彩票-4设置模块一