views:

495

answers:

2

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?

+5  A: 

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.

Tim
Thanks, this helped immensely.
RexOnRoids
A: 

then how should i do, when i want to rotate the image.