animation iOS实现动画
来源:互联网 发布:博客绑定域名 编辑:程序博客网 时间:2024/06/04 17:43
// UIVIEW动画
// 动画特点:全部都是类方法 直接类去调用
// 1.UIView 直接调用的
// 2.Block方法
// 步骤:
// 1.开始动画
// 2.------中间写你要执行的动画
// 3.提交动画
// 开始动画
// 参数1 动画的ID
// 参数2 携带的参数
// [UIView beginAnimations:@"donghua" context:@"hahaha"];
//
//// 设置动画
//// 设置动画执行的时间
// [UIView setAnimationDuration:1];
//// 延时
//// [UIView setAnimationDelay:2];
//// 是否反转
// [UIView setAnimationRepeatAutoreverses:YES];
//// 执行的次数
// [UIView setAnimationRepeatCount:4];
//// 是否继续执行
// [UIView setAnimationBeginsFromCurrentState:YES];
//// 设置下代理
// [UIView setAnimationDelegate:self];
//// 需要我们自己设置代理方法
// [UIView setAnimationWillStartSelector:@selector(animationWillStart:context:)];
// [UIView setAnimationDidStopSelector:@selector(animationDidStop)];
// self.imageV.backgroundColor = [UIColor redColor];
// self.imageV.alpha = .4;
// // 改变位置
// self.imageV.frame = CGRectMake(100, 100, 200, 200);
//
//// 提交动画
// [UIView commitAnimations];
// UIView的Block方法
// 2D仿射 (收拾的方法)
#pragma mark -- 平移
// [UIView animateWithDuration:2 animations:^{
//// 你要执行的动画
//// 改变视图的形变属性
// self.imageV.transform = CGAffineTransformTranslate(self.imageV.transform, 100, 100) ;
// } completion:^(BOOL finished) {
//// block里面在嵌套一个block
// [UIView animateWithDuration:2 animations:^{
// // 动画结束后执行的block
// self.imageV.transform = CGAffineTransformTranslate(self.imageV.transform, -100, -100);
// } completion:^(BOOL finished) {
//
// }];
//
//
//
// }];
#pragma mark -- 缩放
//
// [UIView animateWithDuration:1 animations:^{
// // 填的是比例
// self.imageV.transform = CGAffineTransformScale(self.imageV.transform, 2, 2);
//
// } ];
#pragma mark -- 旋转
// 切换状态
_isRunning = !_isRunning;
[self imageViewRomate];
//
// NSURL *url = [NSURL URLWithString:@"http://pica.nipic.com/2007-11-08/2007118171913119_2.jpg"];
// NSData *data = [NSData dataWithContentsOfURL:url];
// UIImage *image = [UIImage imageWithData:data];
// self.imageV.image = image;
// NSLog(@"点我啊");
}
// 动画特点:全部都是类方法 直接类去调用
// 1.UIView 直接调用的
// 2.Block方法
// 步骤:
// 1.开始动画
// 2.------中间写你要执行的动画
// 3.提交动画
// 开始动画
// 参数1 动画的ID
// 参数2 携带的参数
// [UIView beginAnimations:@"donghua" context:@"hahaha"];
//
//// 设置动画
//// 设置动画执行的时间
// [UIView setAnimationDuration:1];
//// 延时
//// [UIView setAnimationDelay:2];
//// 是否反转
// [UIView setAnimationRepeatAutoreverses:YES];
//// 执行的次数
// [UIView setAnimationRepeatCount:4];
//// 是否继续执行
// [UIView setAnimationBeginsFromCurrentState:YES];
//// 设置下代理
// [UIView setAnimationDelegate:self];
//// 需要我们自己设置代理方法
// [UIView setAnimationWillStartSelector:@selector(animationWillStart:context:)];
// [UIView setAnimationDidStopSelector:@selector(animationDidStop)];
// self.imageV.backgroundColor = [UIColor redColor];
// self.imageV.alpha = .4;
// // 改变位置
// self.imageV.frame = CGRectMake(100, 100, 200, 200);
//
//// 提交动画
// [UIView commitAnimations];
// UIView的Block方法
// 2D仿射 (收拾的方法)
#pragma mark -- 平移
// [UIView animateWithDuration:2 animations:^{
//// 你要执行的动画
//// 改变视图的形变属性
// self.imageV.transform = CGAffineTransformTranslate(self.imageV.transform, 100, 100) ;
// } completion:^(BOOL finished) {
//// block里面在嵌套一个block
// [UIView animateWithDuration:2 animations:^{
// // 动画结束后执行的block
// self.imageV.transform = CGAffineTransformTranslate(self.imageV.transform, -100, -100);
// } completion:^(BOOL finished) {
//
// }];
//
//
//
// }];
#pragma mark -- 缩放
//
// [UIView animateWithDuration:1 animations:^{
// // 填的是比例
// self.imageV.transform = CGAffineTransformScale(self.imageV.transform, 2, 2);
//
// } ];
#pragma mark -- 旋转
// 切换状态
_isRunning = !_isRunning;
[self imageViewRomate];
//
// NSURL *url = [NSURL URLWithString:@"http://pica.nipic.com/2007-11-08/2007118171913119_2.jpg"];
// NSData *data = [NSData dataWithContentsOfURL:url];
// UIImage *image = [UIImage imageWithData:data];
// self.imageV.image = image;
// NSLog(@"点我啊");
}
0 0
- animation iOS实现动画
- iOS动画实现方式 animation key path
- IOS 动画(Animation)
- ios Core Animation 动画
- IOS-动画Animation
- IOS Animation动画基础
- iOS 动画(Animation)总结
- ios animation动画
- 05 Animation 实现动画
- animation-list实现动画
- IOS中通过Core Animation实现简单动画
- 【IOS功能实现】之Core Animation动画开发总结(CALayer)
- iOS中动画实现技术主要是:Core Animation。
- Android Animation学习 实现 IOS 滤镜退出动画
- iOS动画:Core Animation概述
- IOS动画Core Animation详解
- IOS动画Core Animation详解
- iOS开发动画(Animation)总结
- bp神经网络训练例子
- python的不可变量和可变量
- hibernate如何使用小demo
- SSDB - 官方文档 - 中文
- 异或运算
- animation iOS实现动画
- 可重入函数与线程安全
- UI day2 UILabel标签 UITextField文本 UIButton按钮
- oracle中的rownum
- 仿QQ帮助菜单功能
- C语言的函数指针和结构体
- hdu4279 Number
- Android开发之序列化接口
- 虚幻4全部鼠标样式mouse cursors