Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/swift/18.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
iOS Swift导航标题未显示_Ios_Swift_Uinavigationcontroller_Uitabbarcontroller - Fatal编程技术网

iOS Swift导航标题未显示

iOS Swift导航标题未显示,ios,swift,uinavigationcontroller,uitabbarcontroller,Ios,Swift,Uinavigationcontroller,Uitabbarcontroller,我有一个tabbar控制器,在它下面我加载了一些导航控制器。但是我的导航控制器的标题没有显示出来。即使我注意到,如果我在左侧和右侧导航栏项目中添加按钮,它也不会显示 我的选项卡栏设置: 让quranNavigationController=uinNavigationController() //quranNavigationController.navigationBar.titleTextAttributes=textAttributes //quranNavigationController

我有一个tabbar控制器,在它下面我加载了一些导航控制器。但是我的导航控制器的标题没有显示出来。即使我注意到,如果我在左侧和右侧导航栏项目中添加按钮,它也不会显示

我的选项卡栏设置:

让quranNavigationController=uinNavigationController()
//quranNavigationController.navigationBar.titleTextAttributes=textAttributes
//quranNavigationController.navigationBar.tintColor=Colors.primaryTextColor
//quranNavigationController.navigationBar.barTintColor=Colors.navigationBackgroundPrimary
让quranSnackBarController=AppSnackbarController(rootViewController:quranNavigationController)
QuransnakBarController.shouldExtend=false
qurannakbarcontroller.tabBarItem=UITabBarItem(标题:“Books.localized(),图像:UIImage(命名为:“古兰经”),标记:1);
让menuViewController=TestViewController()
让quranController=QuranPrintController()
设sideMenuController=sideMenuController(contentViewController:quranController,menuViewController:menuViewController)
quranNavigationController.ViewController=[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"
    }

}
这就是我的输出。没有显示标题。我试着在左侧和右侧添加按钮。但效果不太好


首先确保Tabbar控制器嵌入导航控制器,然后确保所有控制器都与导航栏连接

像这样


然后使用单独的navigController将导航控制器嵌入到每个视图控制器中

尝试将其添加到ViewdidLoad()中


您是如何设置rootViewController的?
    self.view.bringSubviewToFront(yourbuttonname)