gpt4 book ai didi

ios - 登录屏幕后导航栏为空

转载 作者:行者123 更新时间:2023-11-29 01:08:23 27 4
gpt4 key购买 nike

您好,我目前在项目中遇到导航栏问题。我有一个 Facebook 登录名,在成功登录后,会将用户带到与标签栏 Controller 连接的事件提要。成功登录后,我使用以下代码将用户带到特定屏幕:

     func controllingNavigationAfterLogin()
{ let vcPage = self.storyboard?.instantiateViewControllerWithIdentifier("YourViewControllerStor‌​yboardID") as! YourViewControllerClassName
let vcPageNav = UINavigationController(rootViewController: vcPage)
let appDel = UIApplication.sharedApplication().delegate as! AppDelegate appDelegate.window?.rootViewController = vcPageNav
}

storyboard

这里的Identifier代表tabbarcontroller的storyboard id。到现在为止一切正常,但由于某种我找不到的原因,我的导航标题丢失了。如果有人能帮助我,那就太好了!

Activity Feed view controller with no Navigation title in Simulator

Activity Feed view controller with title in IB

最佳答案

为您的 tabBarController 设置 StoryboardID 并尝试以下操作:

let tabBarController = UIStoryboard(name: "Main", bundle: nil).instantiateViewControllerWithIdentifier("TabBar​Controller")
let appDelegate = UIApplication.sharedApplication().delegate as! AppDelegate
appDelegate.window?.rootViewController = tabBarController

关于ios - 登录屏幕后导航栏为空,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36075230/

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