I want to animate the scaling down of a UIView, but not about its center: about a different point.
As a shot in the dark, I tried translating the view, scaling, then translating back, using a series of CGAffineTransforms. But it doesn't work: it still scales about the center.
Anyone know how to do this?
Thanks very much.
Add the Quartz framework to your project and import the Quartz header
#import <QuartzCore/QuartzCore.h>
You can then set the anchor point of your view (around which animations are based) e.g.
myView.layer.anchorPoint = CGPointMake(0, 0);
Note that the points are values between 0 and 1, with 0,0 being top left on the iPhone
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With