UI组件缩放和旋转
2014-02-04 14:50
369 查看
旋转(注意:值是一个180°PI为单位)
缩放
#pragma mark 改变组件角度旋转 - (IBAction)rotationBlock:(UIButton *)sender { [UIView beginAnimations:nil context:nil]; [UIView setAnimationDuration:.8]; //旋转开始 UIView *redBtn=[self.view viewWithTag:kRedBtnTag]; CGAffineTransform transForm=redBtn.transform; redBtn.transform=CGAffineTransformRotate(transForm, sender.tag==7?-M_PI_4:M_PI_4); [UIView commitAnimations]; } |
#pragma mark 改变组件大小 - (IBAction)changeSize:(UIButton *)sender { UIView *redBtn=[self.view viewWithTag:kRedBtnTag]; [UIView beginAnimations:nil context:nil]; [UIView setAnimationDuration:.8]; //缩放开始 CGAffineTransform form=redBtn.transform; if (sender.tag==9) { redBtn.transform=CGAffineTransformScale(form, 1.5, 1.5); }else{ redBtn.transform=CGAffineTransformScale(form, 0.8, 0.8); } [UIView commitAnimations]; } |
相关文章推荐
- 一行代码搞定图片缩放、旋转、加水印
- 缩放系列(三):一个可以手势缩放、拖拽、旋转的layout
- Unity3D 控制物体移动、旋转、缩放
- UIImage图片处理,旋转、截取、平铺、缩放等操作
- UIImage图片处理,旋转、截取、平铺、缩放等操作
- HTML5 Cavans(5) 平移 缩放 旋转
- <Unity>鼠标拖动物体、按下鼠标左键旋转观察物体、鼠标滚轮缩放视野
- GDI+绘制矩形,并且实现可旋转、缩放、移动功能(基于MFC对话框)
- SWT图片处理(大小缩放,透明,置灰,旋转,反色)
- Android Tween动画 (渐变、缩放、位移、旋转)
- CSS3属性transform详解之(旋转:rotate,缩放:scale,倾斜:skew,移动:translate)
- 仿QQ查看图片的jQuery插件,可旋转,缩放和拖动。
- android开发步步为营之83:android图片处理技术之二(通过Matrix移动缩放旋转错切)
- 【IOS】使用手势对UIImageView进行缩放、旋转和移动
- unity shader-UV平移,旋转,缩放
- android 图片的平移,缩放和旋转
- UIView 的旋转和缩放
- 属性动画(旋转,平移,缩放,透明集合)
- Android 通过Matrix来对图片进行缩放,旋转和平移
- MATLAB批量读取文件夹下的图像,并对图像进行裁剪为指定大小,旋转,缩放,加噪声处理,rgb2hsv,批量保存