右栏按钮在选项卡栏应用程序/ipad 上消失
我有一个问题...目前不知道如何解决...
该应用程序有一个选项卡栏视图,选项卡栏上的所有 ViewController 都具有相同的结构,带有一个带有后退操作的 leftBarButton 和一个rightBarButton 具有特定的功能。
我已经用 IB 进行了所有设计,并且所有视图都已定义并与 IBOutlets 和 UIBarButtons 链接。
TabBar 有 9 个视图,仅两个视图是行不通的。
- 第一个有一个标准的搜索按钮...但是,我不知道为什么,当视图可视化时不可见...相同的解决方案在 iPhone 中工作...很奇怪
- 第二个有一个自定义按钮显示 UIPopOver 视图...我已经在 XIB 中...但在显示视图时未显示。7
我尝试以编程方式在 viewDidLoad 事件上添加按钮,但有时显示,有时不显示...
有什么建议吗?
谢谢!!
I've a problem ... and for the moment don't know how work it out...
The application has a tabbar view, all the ViewController on the TabBar has the same structure, with a leftBarButton with back action and with a rightBarButton with an specific feature.
I've all the design with the IB, and all the views has defined and linked with IBOutlets the UIBarButtons.
The TabBar has 9 views, and just in two doesn't work.
- The first one has an standard search button ... but, I don't know why, is not visible when the view is visualized ... the same solution works in iphone ... is very strange
- The second one has an Custom button which display an UIPopOver view ... I already have in the XIB ... but is not been showed when the view is displayed.7
I try to add programatically the button on viewDidLoad event, but sometimes is showed, sometimes not ...
Any suggestion?
Thanks!!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在测试了所有解决方案但没有任何进展之后...我决定放弃 IB 并从头开始以编程方式创建 UITabBarController。
我做了一个迭代解决方案,一开始只包括一个 UINavigationController,然后逐渐包括其他八个。
我已经在没有任何 NIB 的情况下初始化了 UIViewControllers ...令我惊讶的是,对于某些 UIViewControllers,我收到了 init 方法的异常:
这个类不符合键的键值编码...
通常它当您使用 XIB 并且某些 Outlet 未链接时会引发...为了解决此错误,我使用带有空视图的 ViewController 创建了一个空 NIB,并使用此空 NIB 初始化了 UIViewController。
按照我的问题的顺序...以编程方式我收到了同样的问题...并且相同的视图有相同的问题,并且 rightBarButtonItem 再次消失...
最后,解决方案是更改 UITabBar 上 UIViewController 的顺序..是的,这是不可能的......但是相信我......这是我目前找到的唯一解决方案。
如果有人知道任何其他解决方法......请告诉我。
谢谢 ....
After testing all the solutions without no progress ... I decided to discard the IB and create the UITabBarController programatically from scratch.
I did a iterative solution, including just one UINavigationController at the beginning and incrementally including the others eight.
I have initialized the UIViewControllers without any NIB ... for me surprise for some UIViewControllers I received the exception on the init method:
this class is not key value coding-compliant for the key ...
Usually it has raised when you use XIB and some Outlet is not linked ... to solve this bug I created an empty NIB with a ViewController with an empty View and initialized the UIViewControllers with this empty NIB.
In order of my problem ... programatically I received the same problem ... and the same views have the same problem and the rightBarButtonItem has disappeared again ...
Finally, the solution was change the order of the UIViewController on the UITabBar ... yes, it's impossible ... but trust me ... it was the only solution i found for the moment.
If anybody knows any other workaround ... let me know.
Thanks ....