【发布时间】:2014-08-26 10:20:36
【问题描述】:
我有一个 UILabel。我需要以编程方式旋转它。
我有我的水平 UILabel,例如带有框架:x:0, y:0, w: 200, h:80。
现在我想旋转标签使其垂直: 我试试这段代码:
[self setTransform:CGAffineTransformMakeRotation(M_PI_2 / 2)];
我可以看到旋转的包含文本。但我想旋转整个框架:使用我的代码,UILabel 继续具有相同的框架。
【问题讨论】:
-
Warning: If this property is not the identity transform, the value of the frame property is undefined and therefore should be ignored.来自UIView的transform属性的文档
标签: ios objective-c uilabel cgaffinetransform