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];
精彩评论