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 ...
随机推荐
- Wiki上的Ue4文件结构以及命名规范
https://wiki.unrealengine.com/Assets_Naming_Convention
- DOM基础3
隔行变色 <!DOCTYPE html> <html> <head lang="en"> <meta charset="UTF- ...
- Spring In Action(第三版)读书笔记
第一章 Spring之旅 POJO: plain old java object 简单的java对象 DI:Dependency Injection 依赖注入 构造器注入:构造时作为构造器参数传入 p ...
- div+css定位position详解
div+css定位position详解 1.div+css中的定位position 最主要的两个属性:属性 absolute(绝对定位) relative(相对定位),有他们才造就了div+css布局 ...
- Activiti工作流学习(二)流程实例、执行对象、任务
一.前言 前面说明了基本的流程部署.定义,启动流程实例等基本操作,下面我们继续来学习流程实例.执行对象.任务. 二.流程实例.执行对象说明 整个Activiti的生命周期经过了如下的几个步骤: 1.流 ...
- Leetcode Combination Sum II
Given a collection of candidate numbers (C) and a target number (T), find all unique combinations in ...
- ACM 喷水装置(二)
喷水装置(二) 时间限制:3000 ms | 内存限制:65535 KB 难度:4 描述 有一块草坪,横向长w,纵向长为h,在它的橫向中心线上不同位置处装有n(n<=10000)个点状的 ...
- 【JAVA】Quartz中时间表达式的设置
Quartz中时间表达式的设置-----corn表达式 时间格式: <!-- s m h d m w(?) y(?) -->, 分别对应: 秒>分>小时>日>月 ...
- 升级OS X EI Capition 版本导致cocoapods 使用终端上pod: command not found
1)安装过cocoapods, 那么输入 : sudo gem install -n /usr/local/bin cocoapods 当然 上个步骤解决了我的 难题 2)首先在终端输入 gem so ...
- SVN错误:Attempted to lock an already-locked dir
在eclipse里提交和更新文件是报错: Attempted to lock an already-locked dir svn: Working copy 'F:\workspace\WebFram ...