从“更多”中隐藏标题标签栏控制器中的导航栏一致
我有以下问题。
我的 UINavigationBar 有一个背景图像,因此我必须隐藏导航栏中的所有标题。问题出在 TabBarController 的“更多”导航栏上。我已经设法隐藏它,但这只会在第一次显示时发生。当我从其中选择一个项目并返回时,会再次显示“更多”。
我猜我应该禁用“更多”视图控制器的某种“viewWillAppear”委托方法中的标题,但我不知道该怎么做。
这是我第一次显示“更多”,正如你所看到的,徽标在那里(当然被弄脏了:))但是,更多却没有: http://www.flickr.com/photos/68985587@N02/6272805069/ lightbox/
这是“更多”视图控制器中第一个项目的视图控制器: http://www.flickr.com/photos/68985587@ N02/6272805241/in/photostream/lightbox/
当我按下“更多”左侧按钮后导航栏返回,我得到这个: http://www.flickr.com/photos/68985587@ N02/6273332152/in/photostream/lightbox/
感谢您的帮助!
I have the following issue.
I have a background image for my UINavigationBar so I have to hide all the titles from the Navigation Bars. The problem comes with the "More" Navigation Bar of the TabBarController. I have managed to hide it, but this only happens the first time its shown. When I select an item from within it, and go back, "More" is displayed again.
Im guessing I should disable the title inside some sort of "viewWillAppear" delegate method for the "More" View Controller, yet I have no idea how to do that.
This is the first time I display "More", as you can see, the Logo is there (smudged of course :) ) however, More is not:
http://www.flickr.com/photos/68985587@N02/6272805069/lightbox/
This is the View Controller of the first Item in the "More" View Controller:
http://www.flickr.com/photos/68985587@N02/6272805241/in/photostream/lightbox/
After I press the "More" left button in the Navigation Bar to go back, I get this:
http://www.flickr.com/photos/68985587@N02/6273332152/in/photostream/lightbox/
Thanks for your help!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
解决方案是将委托设置为更多视图控制器并根据委托方法进行操作。
首先,我将委托设置为“更多”视图控制器(在我的例子中是在应用程序委托中):
我继续实现以下方法:
这不仅在第一次而且每次视图控制器出现时都会有效地被调用。即使按下后退按钮。
The solution came by setting the delegate to the more view controller and acting upon the delegate method.
First, I set the delegate to the "more" view controller (in my case in the appdelegate):
the I proceeded to implement the following method:
This effectively gets called not just the first time but everytime the view controller came up. Even when a back button was pressed.
您可以通过实现UITabBarDelegate的委托方法
tabBar:didSelectItem:
来检查UITabBarController的哪个选项卡被点击。如果单击第五项(“更多”项),那么您可以这样设置标题:我希望,它有效,我还没有尝试过。祝你好运!
You can check what tab of the UITabBarController was clicked by implementing the delegate method
tabBar:didSelectItem:
of UITabBarDelegate. If the fifth item (the "More" item) was clicked, then you can set the title like this:I hope, it works, I haven't tried it. Good luck!
我建议您查看此链接此处< /a> 和 此处
Hig,根据超过 5不建议使用图标。您可以搜索 TabBar 的链接。
I suggest you to look at this link here and here
Hig, according to more than 5 icons are not recommended for use. You can search links for TabBar.
您可以替换标签:
因此它与顶部有一个偏移量,使其消失......
You can displace the label:
so it has an offset from top that let it disappear...