views:

239

answers:

1

Hi there,

I've animated moving a UIView as follows:

CGRect rightPop =  CGRectMake(167, 270, 142, 73);       
[UIView beginAnimations:nil context:NULL];
[UIView beginAnimations:nil context:NULL];
[UIView setAnimationBeginsFromCurrentState:YES];
[UIView setAnimationDuration:0.4];
[rightToast setFrame:rightPop];
[UIView commitAnimations];

The animation occurs just fine, but it causes other parts of the app to become animated (eg, navigation bars etc).

Does anyone know how I can stop the other animations?

+2  A: 

It's happening because animation blocks can be nested. You're opening two of them via beginAnimations, but only closing one via commitAnimations. The second animation block is still open, so extra animations are not surprising. I don't know why you're calling beginAnimations twice, it's not necessary. Drop that and things should work normally.

Tom Harrington
THANKS! My app is no longer haunted by the vengeful ghost of our fired employee
Tristan