如何检测cgaffinetransformrotate方法是顺时针还是逆时针旋转?
我需要弄清楚,通过 Cgaffinetransformrrotate 我正在顺时针或逆时针旋转视图。
怎么可能?
I need to figure Out that thorough the Cgaffinetransformrrotate I am rotating the view towards the clockwise or anticlockwise.
how it is possible?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
你必须做这样的事情
YourView.transform = CGAffineTransformMakeRotation( 270.0/180*M_PI );
我认为剩下的事情你可以弄清楚..
You have to do some thing like this
YourView.transform = CGAffineTransformMakeRotation( 270.0/180*M_PI );
I think rest of the thing you can figured out..
仿射变换旋转的角度(以弧度为单位)。在 iOS 中,正值指定逆时针旋转,负值指定顺时针旋转。在 Mac OS X 中,正值指定顺时针旋转,负值指定逆时针旋转。
The angle, in radians, by which to rotate the affine transform. In iOS, a positive value specifies counterclockwise rotation and a negative value specifies clockwise rotation. In Mac OS X, a positive value specifies clockwise rotation and a negative value specifies counterclockwise rotation.
将顺时针旋转视图,并将
逆时针旋转视图,
但文档说:
这些互相矛盾吗?
编辑(作者:jcoleman):这并不矛盾,因为 iOS 的显示方式与 Mac OSX 的显示方式相反。因此,方向被颠倒了。
will rotate the view clockwise, and
will rotate the view Anti clockwise,
But the document says:
does those contradict with each other?
Edit (by jcoleman): There is no contradiction since iOS inverts the display from what Mac OSX does. Therefore the directions are flipped.
will rotate the view clockwise, and
will rotate the view Anti clockwise,
will rotate the view clockwise, and
will rotate the view Anti clockwise,