CGAffineTransformRotate不能像期望的那样工作

时间:2014-02-17 08:13:43

标签: ios objective-c rotation

我的代码如下

self.view1.layer.anchorPoint = CGPointMake(1.0, 0.5);
CGAffineTransform transform = CGAffineTransformRotate(self.view1.transform,M_PI/2);
self.view1.transform = transform;

我的用户界面就像是关注

enter image description here

浅绿色背景视图是view1,它有一个子视图标签。如果我运行代码,在我看来,视图和标签将围绕进度视图的左点旋转M_PI / 2.但事实如下:

enter image description here

1 个答案:

答案 0 :(得分:0)

添加

NSLog(@"%@", self.view1);

检查self.view1 - 是背景视图,而不是标签。 另外我认为你需要改变anchorPoint。

相关问题