如何从 IB 设置 NavifationItem 的标题(我自己的 ViewController 的单独 xib)

发布于 2024-09-08 05:55:16 字数 440 浏览 5 评论 0原文

在这种情况下任何人都可以帮助我吗: 我的应用程序中有导航界面,并将 TestController 推送到导航堆栈

此外,我还有单独的 xib 文件:Test.xib,其中文件所有者是 TestController。 Test.xib 具有仅包含 TextView 的视图(属性 TopBar 设置为 NavigationBar 并显示)。

一切正常:控制器被推入堆栈,显示后退按钮,但没有 TestController 的标题,并且我无法将 NavigationItem 放在视图上以显示自己的标题。

如何在导航栏上的 Test.xib 标题中设置???

PS:以编程方式工作(在 TestController.m -> ViewDidLoad: self.title=@"Test controller";),但我需要来自 IB 的 xib(这是我雇主的要求)

问候,Alex

Can anybody help me in such situation:
I have Navigation interface in my application and push TestController to nav stack

Also I have separate xib file: Test.xib where File owner's is TestController. Test.xib has View (property TopBar set as NavigationBar and it shows) with only TextView.

All works fine: Controller is pushed to stack, Back button is shown but there is no Title of TestController and I can't drop NavigationItem on the View to display own title.

How can I set in Test.xib Title on the NavigationBar ???

PS: Programmatically works (in TestController.m -> ViewDidLoad: self.title=@"Test controller";) but I need exactly in xib from IB (it's requirement of my employer)

Regards, Alex

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

薄荷→糖丶微凉 2024-09-15 05:55:16

添加 UINavigationItem 并在其中设置属性。

Add a UINavigationItem and set the properties there.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文