开发者

Use CGAAffineTransform to rotate a + symbol in the middle?

I want to rotate a + to become an x, but it's not rotating via the center of the +. How can i get it to开发者_运维问答 rotate via that point?


As you suggest just rotate the label :)

CGAffineTransform rotare = CGAffineTransformMakeRotation(45*M_PI/180.0f);
[plusLabel setTransform:rotare];

If the label is not rotating around the + center include the QuartzCore and rotate the [plusLabel layer]

CATransform3D rotate3D = CATransform3DMakeRotation(45*M_PI/180.0f, 0, 0, 1);
[[plusLabel layer] setAnchorPoint:CGPointMake(0.4, 0.6)]; // The center of Plus in my case
[[plusLabel layer] setTransform:rotate3D];
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜