views:

44

answers:

0

I have this UIView class. It has 4 Views in it:

  1. self.view. The view of the class itself.
  2. Above that twitterButtonView that holds:
  3. A UIImageView of a button.
  4. Above that a hidden view of the back of the button.

The self.view has a frame of (30, 380, 68, 66);

I want to be able to tab the button and then it scales up accompanied by a UIViewAnimationTransitionFlipFromRight. Before the animation starts I set the frame of the class to be the whole screen. (I have to do this for the class to still respond to touches) Thats where my button moves to the top left. I'm doing a twitterButtonView.center = somePoint and nothing happens to the button view: (I removed unimportant parts)

        // I save the center of the class. Its where the the class is in the window.
    oldCenter = self.center;
    self.frame = CGRectMake(0, 0, 320, 480);
    // Set the button to the position where the class was.This is x=63 y=413 in the debugger
    // If I return; after this everything is fine and the class has the frame set to the whole
    // screen and the button is at 62,413
    twitterButtonView.center = oldCenter;
    [UIView beginAnimations:@"twitterButtonFlip" context:nil];
    [UIView setAnimationDuration:1.0];
    twitterButtonView.center = CGPointMake(160,220);
    [UIView commitAnimations];

The button moves to the center. But the animation starting point is 34,33. Why is that?