这个标签栏控制器应该嵌入哪里?

Where should this tab bar controller be embedded?

这个项目的初始视图控制器是一个导航控制器。我想在用户登录后稍后在视图层次结构中的视图控制器上显示选项卡栏控制器。

当我在 View Controller 上嵌入一个 Tab Bar Controller 时,我希望它打开,我以编程方式实现的 navigationBar 被一个新的 navigationBar 项目覆盖,按下该项目时,会引导用户返回登录页面.

这是导航栏的代码。

self.navigationController.navigationBar.tintColor = [UIColor whiteColor];

//Changes The Title Color
[self.navigationController.navigationBar setTitleTextAttributes:[NSDictionary dictionaryWithObject:[UIColor whiteColor] forKey:NSForegroundColorAttributeName]];

//Sets The Navigation Controller Font
[self.navigationController.navigationBar setTitleTextAttributes:
[NSDictionary dictionaryWithObjectsAndKeys:
[UIColor whiteColor], NSForegroundColorAttributeName,
[UIFont fontWithName:@"ArialMT" size:12.0], NSFontAttributeName,nil]];
[[UINavigationBar appearance] setBarTintColor:UIColorFromRGB(0x0080ff)];

self.navigationController.navigationBar.translucent = YES;

self.navigationItem.leftBarButtonItem = btnRefresh;

//
self.navigationItem.rightBarButtonItem = btnCompose;

导航栏应该如何在视图控制器上实现:

这是我希望它在视图控制器中嵌入选项卡栏控制器时发生的情况:

在此视图控制器上显示标签栏控制器并保留现有导航栏的正确方法是什么? Apple 关于 Tab Bar Controllers 的文档似乎很广泛,似乎应该以编程方式实现。

根据 Apple 文档,不应将 TabBarController 推送到 UINavigationController。相反,您可以只使用 UITabBar 和 UITabBarDelegate 来获得相同的效果。您可以参考以下 link 文档。

https://developer.apple.com/documentation/uikit/uinavigationcontroller/1621887-pushviewcontroller