简体   繁体   English

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

[英]How can I set title of NavifationItem from IB (separate xib of my own ViewController)

Can anybody help me in such situation: I have Navigation interface in my application and push TestController to nav stack 任何人都可以在这种情况下为我提供帮助:我的应用程序中具有导航界面,并将TestController推送到导航堆栈

Also I have separate xib file: Test.xib where File owner's is TestController. 我也有单独的xib文件:Test.xib,其中文件所有者是TestController。 Test.xib has View (property TopBar set as NavigationBar and it shows) with only TextView. Test.xib具有仅TextView的View(将属性TopBar设置为NavigationBar并显示)。

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. 一切正常:将控制器推入堆栈,显示“后退”按钮,但没有TestController的标题,并且我无法将ViewItem上的NavigationItem放下以显示自己的标题。

How can I set in Test.xib Title on the NavigationBar ??? 如何在NavigationBar上的Test.xib标题中设置?

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) PS:以编程方式工作(在TestController.m-> ViewDidLoad:self.title = @“测试控制器”;中),但我确实需要从IB使用xib(这是我雇主的要求)

Regards, Alex 问候,亚历克斯

添加一个UINavigationItem并在那里设置属性。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何快速将xib视图加载到viewController中? - How can I load fast a xib view into my viewController? 为什么每次在IB中打开它都会修改我的XIB? - Why is my XIB modified every time I open it in IB? 在UIView上显示XIB!如何设置它? - Displaying XIB on UIView!How can i set it? 如何将我自己的 ViewController class 设置为第一个屏幕(根视图) - How to set my own ViewController class as the first screen (root view) 更改与主ViewController类位于单独的.xib中的标签文本 - Changing a label text that is in a separate .xib from main ViewController class iPhone编码:如何在另一个ViewController中设置变量? - iPhone Coding: How can I set a variable in a ViewController from another? 我可以在设置viewController时跳过创建单独的指针吗? - Can I skip creating a separate pointer when setting my viewController? 如何从另一个viewcontroller的图标操作中加载主ViewController的视图? - How can i Load my main ViewController's view, from another viewcontroller's icon action? 从xib调用viewController - Call viewController from xib iPhone应用程序到IPad应用程序如何从ViewController.xib转换到ViewController-iPad.xib? - IPhone App to IPad App How to make transition from ViewController.xib to ViewController-iPad.xib ?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM