Question

I have a TabView based application on the iPhone. On initial loading, I want to flip-animate the screen for showing some settings.

In my AppDelegate, the TabView is added to the window with

[window addSubview:tabBarController.view];

I browsed the web and found this:

[UIView beginAnimations:nil context:nil];
[UIView setAnimationDuration:1.0];
[UIView setAnimationTransition:UIViewAnimationTransitionFlipFromLeft
                       forView:tabBarController.view
                         cache:YES];
[window addSubview:settingsViewController.view];
[UIView commitAnimations];

But when I test this in the simulator the only change I can see is that the TabMenu floats from right to left.

Can this be solved?

Was it helpful?

Solution

You could present the settings view as a modal view. You can specify the animation to flip from right to left.

[settingsViewController.view setModalTransitionStyle:UIModalTransitionStyleFlipHorizontal];
[tabBarController presentModalViewController:settingsViewController animated:YES];

To return:

[self.parentViewController dismissModalViewControllerAnimated:YES];

OTHER TIPS

Thanks, that worked. But I had to insert a navigationController:

UINavigationController *navigationController = [[UINavigationController alloc] initWithRootViewController:settingsViewController];

[navigationController setModalTransitionStyle:UIModalTransitionStyleFlipHorizontal];
[tabBarController presentModalViewController:navigationController animated:YES];

[navigationController release];
[settingsViewController release];

But now the next question: How do I get back? :)

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top