views:

155

answers:

1

the following code yield a standard animation when user selects between tabs on sdk2.0 through 2.2, on sdk3.0 devices it does not. I'm still compiling against 2.0 or 2.2 sdk but running on a device that runs 3.0 version of the OS. descrepcincies code:

- (void)tabBarController:(UITabBarController *)controller didSelectViewController:(UIViewController *)viewController
{
    [UIView beginAnimations:@"someAnimation" context:nil];
    [UIView setAnimationDuration:1.0];
    [UIView setAnimationTransition:UIViewAnimationTransitionFlipFromLeft forView:[[viewController view] superview] cache:YES];
    [UIView commitAnimations];
}

anyone knows how to accomplish this in 3.0? thanx! --tzurs

+1  A: 

Probably what is happening is the wrong view is animating. Try animating the tab controller itself:

- (void)tabBarController:(UITabBarController *)controller didSelectViewController:(UIViewController *)viewController
{
    [UIView beginAnimations:@"someAnimation" context:nil];
    [UIView setAnimationDuration:1.0f];
    [UIView setAnimationTransition:UIViewAnimationTransitionFlipFromLeft forView:[controller view] cache:YES];
    [UIView commitAnimations];
}

And then possibly trying to find the proper subview from there.

rpetrich
this is a good call, it does not do what I want exactly but its "good" enough (flips the entire screen.. instead of just the inner views) BUT works well on both the 3.0 hardware and the 2.0 hardware which means, good enough for me.. :-)
Tzur