Ed *_*rty 13
设置视图的图层的锚点,它在视图 - 局部坐标中从0到1.也就是说,左上角是0,0,右下角是1,1.
例如,默认是围绕中心旋转:
imageView.layer.anchorPoint = CGPointMake(.5,.5);
Run Code Online (Sandbox Code Playgroud)
如果要围绕原点旋转:
imageView.layer.anchorPoint = CGPointMake(0,0);
Run Code Online (Sandbox Code Playgroud)
或中右边缘:
imageView.layer.anchorPoint = CGPointMake(1,.5);
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
10151 次 |
| 最近记录: |