在iPhone上翻转完整的UITabView

发布于 2024-10-01 02:23:44 字数 599 浏览 5 评论 0原文

我在 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 从右向左浮动。

这个问题能解决吗?

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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

囚我心虐我身 2024-10-08 02:23:44

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

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

返回:

[self.parentViewController dismissModalViewControllerAnimated:YES];

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];
银河中√捞星星 2024-10-08 02:23:44

谢谢,这有效。但我必须插入一个导航控制器:

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

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

[navigationController release];
[settingsViewController release];

但现在下一个问题:我如何返回? :)

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? :)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文