I’ll try to simplify the problem as much as I can.
I have an animation block to animate two UIViewImages.
I take the rectangle of the UIImageViews before I start:
I change: origin.x+=40 for both
In the animation block, I set the frame of those two UIImage views to the modified rectangles.
It works.
Now here’s a thing. For one of the rectangles, I’ll also change the size.width-= 20 so that it shrinks a bit in width.
The Result: The shrinking and moving takes place, but the second UIImage view will not move anymore. It’s as if animating a width/height of an element, cancels out all other animations in the animation block.
I can’t figure out why. I’ve been on this for two days now to no avail. Has anyone ever encountered anything like this? I’m on iOS 5.1 Xcode 4.3.2
Even though the frame property can be animated, it is not the recommended way to animate a view.
Instead I suggest that you apply a CGAffineTransform to transform property of the UIImageView.
Here is the Docs link: https://developer.apple.com/library/mac/#documentation/graphicsimaging/reference/CGAffineTransform/Reference/reference.html
In your case, you would apply a scale and translation transform to your image views. Keep in mind that if you want to apply two transforms,you will have to combine them into one first.