Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What happens to the view.frame.size attribute after a CGAffineTransform (Rotate)?

I have a UIImageView that can be resized by pinching in and out (Example: view.frame.size.width+10). The image of the Image View can also be rotated (CGAffineTransformMakeRotate). Okay, here is the problem: When I resize the UIImageView AFTER having had applied a Rotate Transform the view resizes abnormally (inversly (shrink when it should grow, vice-versa) or at enormous resize unit increments). How can I resize my UIImageView in a consistent manner whether or not a CGAffineTransform is applied?

like image 822
RexOnRoids Avatar asked Aug 17 '09 07:08

RexOnRoids


1 Answers

There's a warning in the documentation for UIView that says, for the frame property:

Warning: If the `transform` property is not the identity transform, the value of this property is undefined and therefore should be ignored.

Use the bounds and center properties instead; they remain viable after a transform is applied.

like image 85
Tim Avatar answered Oct 18 '22 12:10

Tim