UITabBar 导航和presentModalViewController

发布于 2024-12-25 04:21:00 字数 346 浏览 1 评论 0原文

我有基于 UITabBar 的导航,并且希望标签栏始终位于其他窗口之上。在一个控制器中,我有打开其他控制器的方法,但是当我使用此 UITabBar 时,它会消失。 我还应该做什么?

ThirdView*third =[[ThirdView alloc] initWithNibName:nil bundle:nil];
third.modalTransitionStyle = UIModalTransitionStyleCrossDissolve;
[self.tabBarController presentModalViewController:third animated:YES];
[third release];

I have UITabBar based navigation and want always tabbar on top other widows. In one controller i have method which opens other controller, but when i use this UITabBar disappear.
What i should do more ?

ThirdView*third =[[ThirdView alloc] initWithNibName:nil bundle:nil];
third.modalTransitionStyle = UIModalTransitionStyleCrossDissolve;
[self.tabBarController presentModalViewController:third animated:YES];
[third release];

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

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

发布评论

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

评论(1

我三岁 2025-01-01 04:21:00

您应该将 UINavigationController 用于 UITabBarController 的选项卡。然后,要呈现一个新的 UIViewController,您需要将新的它推送到 UINavigationController 的堆栈上。你可以这样做:

[self.navigationController PushViewController:yourController
动画:是];

如果你想要模态效果,你可以这样做:

#import <QuartzCore/QuartzCore.h>

 CATransition* transition = [CATransition animation]; transition.duration = 0.4f;
 transition.type = kCATransitionMoveIn;
 transition.subtype = kCATransitionFromTop;
 [self.navigationController.view.layer addAnimation:transition
                                                 forKey:kCATransition]
 [self.navigationController pushViewController:v animated:NO];

You should use UINavigationControllers for the tabs of your UITabBarController. Then to present a new UIViewController you want to push new it onto the stack of your UINavigationController. You can do this like so:

[self.navigationController pushViewController:yourController
animated:YES];

If you want the modal effect, you could do something like this:

#import <QuartzCore/QuartzCore.h>

 CATransition* transition = [CATransition animation]; transition.duration = 0.4f;
 transition.type = kCATransitionMoveIn;
 transition.subtype = kCATransitionFromTop;
 [self.navigationController.view.layer addAnimation:transition
                                                 forKey:kCATransition]
 [self.navigationController pushViewController:v animated:NO];
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文