gpt4 book ai didi

swift - UINavigationController 的 subview 没有 UINavigationItem 来设置标题

转载 作者:行者123 更新时间:2023-11-28 05:45:00 24 4
gpt4 key购买 nike

我实现了一个 UINavigationController 来实现弹出/推送功能。但是,在 subview 上我无法设置导航栏的标题,而只能在第一个 View 上设置:

enter image description here

在上面看到的“Buzzy”页面上,当我选择导航栏时,实用程序选项卡显示它是一个 UINavigationItem,我可以编辑它的标题。但是,在其中一个 subview (例如具有“可点击区域”的 View )上,无法选择导航栏,也无法添加标题。

如何为 subview 添加标题?

最佳答案

将导航项对象从对象面板(cmd-shift-L)拖到 View Controller 上并选择它。

enter image description here

您现在应该能够设置标题、添加 UIBarButtonItems 等。

关于swift - UINavigationController 的 subview 没有 UINavigationItem 来设置标题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55138406/

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