我有一个tabBarController,在其下加载了一些导航控制器。但是我的导航控制器的标题没有显示。甚至我也注意到,如果在左右导航栏项中添加按钮,该项也不会显示。
我的标签栏设置:
let quranNavigationController = UINavigationController()
// quranNavigationController.navigationBar.titleTextAttributes = textAttributes
// quranNavigationController.navigationBar.tintColor = Colors.primaryTextColor
// quranNavigationController.navigationBar.barTintColor = Colors.navigationBackgroundPrimary
let quransnackBarController = AppsnackbarController(rootViewController: quranNavigationController)
quransnackBarController.shouldExtend = false
quransnackBarController.tabBarItem = UITabBarItem(title: "Books".localized(),image: UIImage(named: "quran"),tag: 1);
let menuViewController = TestViewController()
let quranController = QuranPrintController()
let sideMenuController = SideMenuController(contentViewController: quranController,menuViewController: menuViewController)
quranNavigationController.viewControllers = [sideMenuController]
tabBarController.viewControllers = [homeNavigationController2,quransnackBarController,prayerNavigationController,duasnackBarController]
window.rootViewController = tabBarController
QuranPrintController:
class QuranPrintController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
self.title = "Quran"
self.navigationItem.title = "Prayer Times"
}
}
这是我的输出。没有标题显示。我尝试在左侧和右侧添加按钮。但是效果不佳