gpt4 book ai didi

ios - 标签栏项目不显示

转载 作者:行者123 更新时间:2023-11-29 02:05:19 26 4
gpt4 key购买 nike

    if(!isUserLoggedIn){

var loginViewController = mainStoryBoard.instantiateViewControllerWithIdentifier("loginView") as! LoginViewController

window!.rootViewController = loginViewController
window!.makeKeyAndVisible()

}else{

var mainViewController = mainStoryBoard.instantiateViewControllerWithIdentifier("mainView") as! FirstViewController
var myDealsViewController = mainStoryBoard.instantiateViewControllerWithIdentifier("myDealsViewController") as!MyDealsViewController
var settingsViewController = mainStoryBoard.instantiateViewControllerWithIdentifier("settingsView") as! SettingsViewController
var centerNav = UINavigationController(rootViewController: mainViewController) as UINavigationController
var myDealNavController = UINavigationController(rootViewController: myDealsViewController) as UINavigationController
let controllers = [centerNav,myDealNavController,settingsViewController]
tabBarController.viewControllers = controllers

window!.rootViewController = tabBarController
window!.makeKeyAndVisible()
}

上面的代码可以工作,但应用程序没有显示选项卡栏项目,即使当我单击中心选项卡栏项目时它可以工作。

enter image description here

enter image description here

最佳答案

将您的代码行替换为:

var myDealNavController = mainStoryBoard.instantiateViewControllerWithIdentifier("myDealNavController") as! UINavigationController

并在 Storyboard中将“myDealNavController”设置为您的 UINavigationController 的标识符。

关于ios - 标签栏项目不显示,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29843497/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com