4

Does OS X have an equivalent of [UIView setTransform:] on iOS? I have an NSTextField that I want to rotate 10 degrees. In iOS I’d just use [UILabel setTransform:]. Is there anything equivalent for Cocoa Framework?

4

2 回答 2

11

frameRotation或者frameCenterRotation应该这样做

于 2013-07-09T13:52:36.767 回答
4

您可以使用底层并旋转它

myView.wantsLayer = YES;
myView.layer.transform = CATransform3DMakeRotation(angle, 0, 0, 1);

ps 记得导入 QuartzCore

于 2013-07-09T13:52:26.557 回答