UIImageView jumps down/right when scaling

96 Views Asked by At

I'am trying to scale an UIImageView from its center. The center scale works, but I have a problem! When i touches the image, it jumps down/right while it scale.

Here is my code:

[UIView animateWithDuration:0.5
                          delay:1
                        options:UIViewAnimationOptionBeginFromCurrentState
                     animations:(void (^)(void)) ^{
                        elefant.transform = CGAffineTransformMakeScale(1.5, 1.5);
                     }
                     completion:^(BOOL finished){
                         //elefant.transform=CGAffineTransformIdentity;
                     }];

Note: when i show the size inspector for this UIImageView, the origin has an arrow pointing down and right, from the upper left corner. I tried to make this center, but it doesn't help.

Hope to find help here, and thanks in advance.

/Troels

1

There are 1 best solutions below

0
On

To solve this problem, I had to turn off auto layout.