gpt4 book ai didi

ios - 为嵌入式 UITabBar subview 设置不同的 UINavigationController 标题?

转载 作者:可可西里 更新时间:2023-11-01 03:26:56 25 4
gpt4 key购买 nike

在我的应用程序中,我在 UINavigationController 中嵌入了一个 UITabBarController。问题是 UINavigationController 将该选项卡栏视为单个 View Controller ,即使其中有 4 个选项卡。我需要为导航栏标题中显示的这 4 个选项卡中的每一个设置不同的标题标题。在这 4 个 View 的子类上使用 self.title 没有任何作用。它只是不断地在导航栏中显示相同的标题,因为正如我所说,UINavigationController 将整个选项卡栏 Controller 视为单个 View 。

如何为选项卡栏 Controller 内的选项卡的每个 View 设置单独的标题?

最佳答案

尝试在每个选项卡的 View Controller 中使用 [self.navigationItem setTitle:]。如果这不起作用,请尝试更深入,[self.tabBarController.navigationItem setTitle:]

关于ios - 为嵌入式 UITabBar subview 设置不同的 UINavigationController 标题?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20134969/

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