gpt4 book ai didi

ios - 如何在 swift iOS 中自定义导航 Controller

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

我正在尝试自定义导航 Controller ,但它不起作用

我认为这是因为我正在使用应用程序委托(delegate)通过以下代码从一个 View 移动到另一个 View :

let mainStoryboardIpad : UIStoryboard = UIStoryboard(name: "Main", bundle: nil)
let initialViewControlleripad : UIViewController = mainStoryboardIpad.instantiateViewControllerWithIdentifier("HomeView") as! ViewControllerHome
self.window = UIWindow(frame: UIScreen.mainScreen().bounds)
self.window?.rootViewController = initialViewControlleripad
self.window?.makeKeyAndVisible()

我的 Storyboard

My story board

我正在使用 Storyboard更改标题,或者以编程方式更改标题,但它不起作用,并且我没有看到标题发生变化

self.navigationController?.title="Mytitle"

最佳答案

您应该更改导航 Controller 内 View Controller 的标题,而不是导航 Controller 本身。

关于ios - 如何在 swift iOS 中自定义导航 Controller ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32067485/

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