ios - 如何从嵌入在导航 Controller 中的简单 View Controller 调用选项卡栏 View Controller ?

标签 ios objective-c swift xcode

如何从简单的 UIViewController 调用 TabbarViewControllers 连接的 viewController,其中简单的 UIViewController 嵌入在 UINavigationController 中。当将一个 View Controller 移动到另一个 View Controller 时,我想要 UINavigationController 提供的相同的 Push 和 Pop 效果。在谷歌中挖掘后,我发现在导航堆栈中推送标签栏 View Controller 并不是构建应用程序的好方法。我尝试创建自定义交易动画,但它与 UINavigation 交易效果不同。请给出一些建议或解决方案。谢谢!!

最佳答案

可以直接将UITabbarController设置为window的rootViewController。

UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"Main" bundle:nil];
_tabObj = (TabbarViewController*) [storyboard instantiateViewControllerWithIdentifier:@"TabbarViewController"];
self.window.rootViewController = _tabObj;

检查上面的代码。

关于ios - 如何从嵌入在导航 Controller 中的简单 View Controller 调用选项卡栏 View Controller ?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45351513/

相关文章:

ios - 哪个浏览器有这个奇怪的用户代理? (IOS设备)

ios - Swift - 如何显示跟踪事件的 MKPolyline

objective-c - ld : framework not found GData

objective-c - NSBezierPath 三次贝塞尔曲线To 看起来像一条直线

swift - SwiftUI 中的推送、弹出 View Controller 等效项

swift - 由于未捕获的异常 'NSInvalidArgumentException' 无法识别的选择器发送到实例 0x7fdab8596b40' 而终止应用程序

ios - 游戏开发菜单

iphone - 如何在iphone中实现google搜索应用

ios - 在 UIPickerView 中显示来自多个组件的文本

swift - 上传图像到解析失败