控件的平移旋转缩放transform
2016-06-05 00:00
337 查看
摘要: 控件的平移旋转缩放transform
####2.控件的旋转
####3.控件的缩放
####4.控件的平移旋转缩放
####5.github
github
控件的平移旋转缩放
####1.控件的平移@interface ViewController () @property (nonatomic,strong) UIView *tempView; @end - (void)viewDidLoad { [super viewDidLoad]; self.tempView=[[UIView alloc]initWithFrame:CGRectMake(50, 50, 100, 100)]; self.tempView.backgroundColor=[UIColor redColor]; [self.view addSubview:self.tempView]; } -(void) touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event{ self.tempView.transform=CGAffineTransformMakeTranslation(50, 50); }
####2.控件的旋转
-(void) touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event{ //self.tempView.transform=CGAffineTransformMakeTranslation(50, 50); [UIView animateWithDuration:1.0 animations:^{ self.tempView.transform=CGAffineTransformMakeRotation(M_PI_4); }]; }
####3.控件的缩放
-(void) touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event{ //self.tempView.transform=CGAffineTransformMakeTranslation(50, 50); [UIView animateWithDuration:1.0 animations:^{ self.tempView.transform=CGAffineTransformMakeScale(0.5, 0.5); }]; }
####4.控件的平移旋转缩放
-(void) touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event{ //self.tempView.transform=CGAffineTransformMakeTranslation(50, 50); [UIView animateWithDuration:1.0 animations:^{ //同时进行两种transform CGAffineTransform transform=CGAffineTransformMakeTranslation(50, 50); CGAffineTransform scaleTransform=CGAffineTransformScale(transform, 0.5, 0.5); self.tempView.transform=scaleTransform; }]; self.tempView.transform=CGAffineTransformIdentity; }
####5.github
github
相关文章推荐
- css transform 3D幻灯片特效实现步骤解读
- Android变形(Transform)之Camera使用介绍
- iOS图片放大的方式(transform和frame)
- CSS3中3D综合应用及分析
- Transform/Transition/Animation的区别与联系
- CSS3中的transform属性进行2D和3D变换的基本用法
- 实例讲解CSS3中Transform的perspective属性的用法
- 深入剖析CSS变形transform(3d)
- IOS UI transform 属性
- 2016.1.13
- CSS3 - transform属性
- transform属性
- 小议layerX/Y offsetX/Y 的区别 In Chrome
- 使用CGAffineTransformMakeRotation画有图形的圆
- CSS3转换过渡动画效果总结
- UIView的frame,bounds,tramsform的简单使用
- css动画效果transtion,transform,animation
- Hough变换背后的机制
- Transform.RotateAround
- iOS---transform类的使用,平移,缩放,旋转效果的实现