I\'m trying to rotate an UIView
a few radians but after applying the transformation it doesn\'t look to be keeping its size. What\'s the proper way to achieve t
The CGAffineTransformRotate
transformation rotates from an existing affine transform. The fact that you are using CGAffineTransformIdentity
might be the issue. You must specify the current transform of your view.
#define DEGREES_TO_RADIANS(angle) ((angle) / 180.0 * M_PI)
...
double rads = DEGREES_TO_RADIANS(240);
CGAffineTransform transform = CGAffineTransformRotate(self.arrowView.transform, rads);
self.arrowView.transform = transform;
Also, you might want to consider:
self.arrowView.transform = CGAffineTransformMakeRotation(rads);
EDIT : If you can, share what you kind of transformation (animated/inanimate , single/iterative) you want to achieve. I believe there might be a better, optimized way of doing this.