views:

14

answers:

0

I have views that can be rotated, scaled and moved around the screen. I want the view to resize and be orthogonal when the user double tap's the view to edit the textview within.

The code is below.

Somewhere the transform is getting reset. The NSLog statement below prints the identity transform, but a print of the transform when the animation is complete in transitionDidStop reveals that the transform is what it was before I thought I set it to identity. The view resizes, but it acts like the transform was never set to identity?

Any ideas/pointers?

            originalBounds = self.bounds;
        originalCenter = self.center;
        originalTransform = self.transform;

        r = CGRectMake(0, 0, [UIScreen mainScreen].bounds.size.width - 70, 450);

        [UIView beginAnimations: nil context: NULL];
        [UIView setAnimationDelegate: self];
        [UIView setAnimationDidStopSelector: @selector(transitionDidStop:finished:context:)];
        self.transform = CGAffineTransformIdentity;
        NSLog(@"%@ after set", NSStringFromCGAffineTransform([self transform]));
        [self setBounds: r];
        [self setCenter: p];
        [self setAlpha: 1.0];
        [UIView commitAnimations];
        [textView becomeFirstResponder];