IOS第18天(1,核心动画layer, 旋转,缩放,平移,边框,剪裁,圆角)
****动画效果
- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
{
[UIView animateWithDuration: animations:^{ // 旋转
// _imageView.layer.transform = CATransform3DMakeRotation(M_PI, 1, 1, 0);
// 平移
// _imageView.layer.transform = CATransform3DMakeTranslation(200, 200, 0); // 缩放
// _imageView.layer.transform = CATransform3DMakeScale(1, 0.5, 1); // 利用KVC改变形变 // NSValue *rotation = [NSValue valueWithCATransform3D:CATransform3DMakeRotation(M_PI, 1, 1, 0)]; // [_imageView.layer setValue:rotation forKeyPath:@"transform"]; // [_imageView.layer setValue:@M_PI forKeyPath:@"transform.rotation"]; // [_imageView.layer setValue:@0.5 forKeyPath:@"transform.scale"]; // 平移x轴
[_imageView.layer setValue:@ forKeyPath:@"transform.translation.x"]; }];
}
******边框,圆角 ,剪裁
- (void)imageLayer
{
// 圆形裁剪
_imageView.layer.cornerRadius = ; // 超出layer边框的全部裁剪掉
_imageView.layer.masksToBounds = YES; _imageView.layer.borderColor = [UIColor whiteColor].CGColor;
_imageView.layer.borderWidth = ;
} - (void)viewLayer
{
// 设置阴影透明度
_redView.layer.shadowOpacity = ; // 设置阴影颜色
_redView.layer.shadowColor = [UIColor yellowColor].CGColor; // 设置阴影圆角半径
_redView.layer.shadowRadius = ; // 设置圆角半径
_redView.layer.cornerRadius = ; // 设置边框半径
_redView.layer.borderColor = [UIColor whiteColor].CGColor; // 设置边框半径
_redView.layer.borderWidth = ;
}
IOS第18天(1,核心动画layer, 旋转,缩放,平移,边框,剪裁,圆角)的更多相关文章
- IOS第18天(9,核心动画-动画组)
****动画组 // 核心动画都是假象,不能改变layer的真实属性的值// 展示的位置和实际的位置不同.实际位置永远在最开始位置 #import "HMViewController.h&q ...
- IOS第18天(10,核心动画-转盘,自定义buton,旋转动画)
*****HMViewController.m #import "HMViewController.h" #import "HMWheelView.h" @in ...
- IOS第18天(8,核心动画转场动画)
***翻页效果 #import "HMViewController.h" @interface HMViewController () @property (weak, nonat ...
- IOS第18天(4,核心动画,时钟效果,定时器,图片旋转角度,CALayer 锚点,获取当前,小时,秒,分)
**** #import "HMViewController.h" // 每秒秒针转6度 #define perSecendA 6 // 每分钟分针转6度 #define perM ...
- [iOS UI进阶 - 6.1] 核心动画CoreAnimation
A.基本知识 1.概念 Core Animation是一组非常强大的动画处理API,使用它能做出非常炫丽的动画效果,而且往往是事半功倍,使用它需要先添加QuartzCore.framework和引入对 ...
- ios开发之图层与核心动画一:图层CALayer的认识
#import "ViewController.h" @interface ViewController () @property (weak, nonatomic) IBOutl ...
- [iOS UI进阶 - 6.2] 核心动画CoreAnimation 练习代码
A.基本用法 1.CABasicAnimation // // ViewController.m // CoreAnimationTest // // Created by hellovoidworl ...
- iOS UI进阶-3.0 核心动画
Core Animation是一组非常强大的动画处理API,使用它能做出非常炫丽的动画效果,而且往往是事半功倍,使用它需要先添加QuartzCore.framework和引入对应的框架<Quar ...
- CoreAnimation 核心动画 / CABasicAnimation/ CAKeyframeAnimation
- (void)createBaseAnimation{ //基础动画 CABasicAnimation *animation = [CABasicAnimation animation]; anim ...
随机推荐
- WebSocket协议开发
一直以来,网络在很大程度上都是围绕着HTTP的请求/响应模式而构建的.客户端加载一个网页,然后直到用户点击下一页之前,什么都不会发生.在2005年左右,Ajax开始让网络变得更加动态了.但所有的HTT ...
- Spring事务解析4-切面织入
BeanFactoryTransactionAttributeSourceAdvisor作为Advisor的实现类,自然要遵从Advisor的处理方式,当代理被调用时会调用这个类的增强方法,也就是此b ...
- DSP using MATLAB 示例 Example3.15
上代码: subplot(1,1,1); b = 1; a = [1, -0.8]; n = [0:100]; x = cos(0.05*pi*n); y = filter(b,a,x); figur ...
- css整理-04 基本视觉格式化
基本框 假定每一个元素都会生成一个火多个矩形框,为元素框 元素框中心有一个内容区,周围有内边距,边距和外边距 内容的背景会应用到内边距,外边距是透明的,可以看到父元素的背景 内边距不能是负值,外边距可 ...
- css自适应代码-iphone端
@media (device-height:480px) and (-webkit-min-device-pixel-ratio:2) {/* 兼容iphone4/4s */} @media (dev ...
- http://www.cnblogs.com/meiCode/p/5896239.html
http://www.cnblogs.com/meiCode/p/5896239.html
- 微软开放WP开发者回复用户应用评论功能
1 4月18日,据The NextWeb网站报道,微软今天公布了一项新的开发者试点项目:回复Windows Phone应用评论.该公司表示,它们将在本周推出这项功能,不过目前仅对部分开发者开放. ...
- How to: 使用 数据流 实现生产者-消费者模式
producer把消息发送到消息块,consumer从块读取消息. 安装: Install-Package Microsoft.Tpl.Dataflow using System.Thread ...
- uva-465(overflow)
这道题很奇葩啊,WA了4发...妈的,用c++也不至于,输出竟然要原样输出... 例如: 0000000000000000006 * 000000000000001 输出是 0000000000000 ...
- 【Xcelsius】在PPT中嵌入水晶易表Xcelsius2008仪表盘
如果您使用Xcelsius创建了动画图形,并将其保存为 Shockwave® 文件(.swf 文件扩展名).但是往往插入进去之后,会产生一些比较棘手的问题,比如ppt不会自动播放,错误等等.今天把这些 ...