On Jun 17, 2009, at 11:28 PM, David Duncan wrote:

On Jun 17, 2009, at 1:58 PM, WT wrote:

my understanding was that the OP wanted to do all three operations concurrently. Of course, if he wants simply to move, then scale, and then rotate, there are easier ways to accomplish that than to use transforms.

You can set the center & transform of a view within the same animation block and both animations will occur concurrently.

Yes, of course! Duh... in my haste to answer, I misunderstood what you said in your previous post. Your comment provides the clearest and cleanest solution:

    CGRect screenBounds = [[UIScreen mainScreen] bounds];
    CGPoint screenCenter = { CGRectGetMidX(screenBounds),
                             CGRectGetMidY(screenBounds) };

    [UIView beginAnimations: nil context: NULL];
    [UIView setAnimationDuration: kAnimDuration];
    [UIView setAnimationDelegate: self];
    [UIView setAnimationCurve: UIViewAnimationCurveEaseInOut];

    CGAffineTransform transform;
    transform = CGAffineTransformMakeScale(kScaleX, kScaleY);
transform = CGAffineTransformRotate(transform, DEGS_TO_RADS(kAngleInDegrees));
    imgView.transform = transform;

    imgView.center = screenCenter;

    [UIView commitAnimations];

For future reference and for the benefit of the OP, I've now updated my sample project.

Wagner
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to