【发布时间】:2015-07-17 08:36:03
【问题描述】:
我正在尝试做一些类似于附加图像的事情。
我认为这个页面会导致答案
http://www.informit.com/articles/article.aspx?p=2149190&seqNum=13
或
但是将 objC 转换为 swift 很麻烦。我可以很容易地画出我的箭头,但是让 NSString 旋转然后翻译是有问题的。它会做一些奇怪的事情,比如画出屏幕、错误的角度等。
我已经尝试过这个和许多变体
CGContextSaveGState(context)
CGContextRotateCTM(context, dTheta[i])
CGContextTranslateCTM(context, -s.sizeWithAttributes(attributes).width / 2.0, -radiusY )
s.drawAtPoint(CGPoint(x: x + xOffset*0.0 , y: y + yOffset*0.0 ), withAttributes: attributes)
//s.drawAtPoint(CGPointMake(0, 0), withAttributes: attributes)
CGContextRestoreGState(context)
【问题讨论】:
标签: swift nsstring calayer quartz-graphics