如何使用修复点旋转UIIMageVIew? [英] how to rotate UIIMageVIew with fix point?

查看:85
本文介绍了如何使用修复点旋转UIIMageVIew?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在角度上旋转图像。但我想用固定点旋转图像。如何设置此修复点?

I want to rotate image on angle.But i wnt to rotate image with fix point.How can i set this fix point?

推荐答案

设置视图的图层的锚点,它在视图 - 局部坐标中从0到1.也就是说,左上角是0,0,右下角是1,1。

Set the view's layer's anchorpoint, which is in view-local coordinates from 0 to 1. That is, the top left is 0,0 and the bottom right is 1,1.

例如,默认是围绕中心旋转:

For example, the default is to rotate around the center:

imageView.layer.anchorPoint = CGPointMake(.5,.5);

如果你想围绕原点轮换:

If you want to rotate around the origin:

imageView.layer.anchorPoint = CGPointMake(0,0);

或中右边缘:

imageView.layer.anchorPoint = CGPointMake(1,.5);

这篇关于如何使用修复点旋转UIIMageVIew?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆