1

我在 iPhone 上有一个基于 TabView 的应用程序。在初始加载时,我想翻转屏幕以显示一些设置。

在我的 AppDelegate 中,将 TabView 添加到窗口中

[window addSubview:tabBarController.view];

我浏览了网页,发现了这个:

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

但是当我在模拟器中测试它时,我能看到的唯一变化是 TabMenu 从右向左浮动。

这可以解决吗?

4

2 回答 2

1

您可以将设置视图呈现为模态视图。您可以指定动画从右向左翻转。

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

返回:

[self.parentViewController dismissModalViewControllerAnimated:YES];
于 2010-11-06T10:55:06.397 回答
0

谢谢,那行得通。但我必须插入一个导航控制器:

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

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

[navigationController release];
[settingsViewController release];

但现在下一个问题:我怎么回来?:)

于 2010-11-06T11:22:27.400 回答