Affine Transform and UIView’s Frame vs. Center property

By July 24, 2012Blog

When using affine transform to rotate views (UIIMageView in most cases, right?) for example like this:

CGAffineTransform transform = 
	CGAffineTransformMakeRotation(-b->GetAngle());
 
oneView.transform = transform;

 

 Make sure you then translate the object using its center property and not using the frame property, as frame is already affected by the affine transform and your image would be corrupted.

Happy coding!