UI 动画之反射变换的平移
来源:互联网 发布:东京著衣淘宝上没有了 编辑:程序博客网 时间:2024/05/21 01:53
@interface ViewController ()
//准备一个用于动画的UIView
@property(nonatomic,strong)UILabel *customLabel;
//静止,用来对比
@property(nonatomic,strong)UIView *staticView;
@end
@implementation ViewController
- (void)viewDidLoad {
[superviewDidLoad];
//动画影响的属性:frame、center、bounds、background、alpha、transform、
//定义好自定义label
self.customLabel = [[UILabelalloc]initWithFrame:CGRectMake(0,0,100,100)];
_customLabel.backgroundColor = [UIColormagentaColor];
_customLabel.center =self.view.center;
[self.viewaddSubview:_customLabel];
self.view.backgroundColor = [UIColorcyanColor];
//加一个可以对比的视图,可以直观的看出动画效果。
self.staticView = [[UIViewalloc]initWithFrame:CGRectMake(0,0,100,100)];
_staticView.center =self.view.center;
_staticView.backgroundColor = [UIColorpurpleColor];
[self.viewinsertSubview:_staticViewbelowSubview:_customLabel];
}
#pragma mark 模拟 动画
-(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
{
//开启动画之旅
[UILabelbeginAnimations:nilcontext:nil];
//之间就是定义动画
//切圆角
[_customLabel.layersetCornerRadius:50];
[_customLabel.layersetMasksToBounds:YES];
#pragma mark 平移
//三选一 :建议用第三种。
//在初始状态平移
//第一种:最繁琐
_customLabel.transform =CGAffineTransformMake(1,0,0, 1, 34, 23);
//第二种,稍微好点
_customLabel.transform =CGAffineTransformMakeTranslation(50,50);
//第三种:灵活
//在上一次的基础上平移
_customLabel.transform =CGAffineTransformTranslate(_customLabel.transform,12,30);
//提交动画
[UILabelcommitAnimations];
}
- UI 动画之反射变换的平移
- UI 动画之反射变换的缩放
- UI 动画之反射变换的旋转
- Matlab图像的几何变换之图像平移
- Opencv 3仿射变换之缩放 平移 旋转 倾斜 反射 透视
- 图像处理学习笔记之图像的几何变换(2)平移变换
- 平移变换
- 平移变换
- 动画之补间平移动画
- 图像几何变换之图像位置变换之图像平移
- #777 – 平移变换动画(Animating a Transform)
- iOS学习之UI初级————CGAffineTransform坐标系统变换以及UIView的属性动画
- OpenGL的glTranslatef平移变换函数详解
- 矩阵的旋转平移正变换及反变换
- 平移动画
- 平移动画
- Animation之TranslateAnimation(平移动画)
- Animation之TranslateAnimation(平移动画)
- http/https 介绍 ----Secure Hypertext Transfer Protocol 安全超文本传输协议
- tools:context=".MainActivity的作用
- Python FunnyPoint--Programing
- 关于Java
- 今始不惑(高中毕业20周年记)
- UI 动画之反射变换的平移
- MyBatis-Spring配置简单了解
- 冒泡排序
- Spring与Mybatis整合的MapperScannerConfigurer处理过程源码分析
- Android源码开发之长按power键添加GlobalActions
- struts2国际化实现过程(解决中文乱码)
- Eclipse快捷键
- 第6周-找出一个整数的因子
- 运行异常与一般异常