CAlayer层的属性position和anchorPoint
来源:互联网 发布:手机怎样看网络直播 编辑:程序博客网 时间:2024/05/22 17:10
1.简单介绍
CALayer有2个非常重要的属性:position和anchorPoint
@property CGPoint position;
用来设置CALayer在父层中的位置
以父层的左上角为原点(0, 0)
@property CGPoint anchorPoint;
称为"定位点"、"锚点"
决定着CALayer身上的哪个点会在position属性所指的位置
以自己的左上角为原点(0, 0)
它的x、y取值范围都是0~1,默认值为(0.5, 0.5)
2.图示
anchorPoint
它的取值为0~1
红色图层的anchorPoint为(0,0)
红色图层的anchorPoint为(0.5,0.5)
红色图层的anchorPoint为(1,1)
红色图层的anchorPoint为(0.5,0)
position和anchorPoint
添加一个红色图层到绿色图层上,红色图层显示到什么位置,由position属性决定
假设红色图层的position是(100,100)
到底把红色图层的哪个点移动到(100,100)的坐标位置,由锚点确定的。
红色图层的锚点是(0,0)
红色图层的锚点是(0.5,0.5)
红色图层的锚点是(1,1)
红色图层的锚点是(0.5,0)
0 0
- CAlayer层的属性position和anchorPoint
- iOS开发UI篇—CAlayer层的属性(position、anchorPoint) 和隐式动画
- iOS开发UI篇—CAlayer层的属性,关于position和anchorPoint介绍
- CALayer的position和anchorPoint
- CALayer的position和anchorPoint
- CALayer的anchorPoint和position
- CALayer中anchorPoint和position的用法
- CALayer中anchorPoint和position的用法
- CALayer中anchorPoint和position的用法
- CALayer和position和anchorPoint
- CALayer的position与anchorPoint
- ios-day18-03(CALayer的两个属性position和anchorPoint(锚点))
- iOS CALayer中position和anchorPoint的联系和区别
- 理解CALayer中position与anchorPoint属性
- iOS开发19-iOS CALayer的position和anchorPoint
- IOS CALayer中的position 和 anchorPoint
- 彻底理解CALayer的position与anchorPoint
- ios CALayer的Frame,bounds,position,anchorPoint
- 怎样快速学习一门新技术
- 远程连接redis问题集合
- java 性能分析jstack, jstat, jmap, jinfo详解
- arm汇编—bic ,orr
- STM32CubeMX创建工程实现双DAC波形输出
- CAlayer层的属性position和anchorPoint
- .babelrc文件的一些简单的配置
- 记录在Win7系统中搭建IIS服务器过程
- spring MVC环境搭建
- codeforces-752【A找规律】【set+pair】
- tcp三次握手和四次挥手
- 方法的定义及格式
- Java学习篇之MySQL数据库安装配置步骤详解
- 函数指针