Quartz 框架 (Mac) 需要说明
I have some labels I need to be rotated, and I asked a question earlier about how to do so:
Apparently the best way to do this is via the layer property of the Quartz Framework? Can someone give a newbie an explanation on how to do this? :) I will award an answer quickly!
Zach
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以简单地使用 NSView 的 setBoundsRotation: 方法来设置它,而不需要 CoreAnimation。
如果你真的想使用 CoreAnimation 你会这样:
You could simply use
NSView
'ssetBoundsRotation:
method to set it without CoreAnimation.If you really want to use CoreAnimation you would go like this:
Layer 是 UIView 的一个属性,它为您提供了一个 CALayer 类型的对象,您可以对其应用转换,例如
会给您一个颠倒的标签。
layer is a property of UIView and gives you an object of type CALayer to which you can apply a transformation, like
which will give you an upside down label.