gpt4 book ai didi

ios - 不能用导航栏做任何事情

转载 作者:行者123 更新时间:2023-12-01 19:09:19 25 4
gpt4 key购买 nike

我有这个结构:

storyboard screenshot

当我想从 Storyboard 中添加“UINavigationItem”时,导航栏被“禁用”,所以我尝试以编程方式添加右键:

UIBarButtonItem *button = [[UIBarButtonItem alloc]
initWithBarButtonSystemItem:UIBarButtonSystemItemAdd
target:self
action:@selector(showPickerView:)];
self.navigationItem.rightBarButtonItem = button;

但什么也没有发生。我从 Storyboard 重命名了导航栏标题,但是当我运行应用程序时,标题没有设置。我真的不知道问题的根源是什么。只是出现了后退按钮。
感谢您的帮助。

最佳答案

标签栏 Controller 中的每个项目都应该有一个导航 Controller 作为根 Controller (好吧,如果你不需要它们,你不需要它们都拥有一个导航 Controller )。您当前拥有的是导航 Controller 中的标签栏 Controller (除非它是模态的),因此标签栏 Controller 中包含的 View Controller 无法看到导航 Controller 。

关于ios - 不能用导航栏做任何事情,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17705285/

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