Custom View in tab bar does no longer work in iOS6

随声附和 提交于 2019-12-10 10:57:04

问题


I have a custom View (UILabel + UIImage) which I use as the custom view of my UINavigationController which I set like so:

self.navigationItem.titleView = self.myTitleLabel;

This works fine in iOS 5 but ceases to work under iOS 6. Although the value is set in the debugger, it does not show at all.

Update: As mark pointed out the docs states the following:

If this property value is nil, the navigation item’s title is displayed in the center of the navigation bar when the receiver is the top item. If you set this property to a custom title, it is displayed instead of the title. This property is ignored if leftBarButtonItem is not nil.

Now I have a backButton and not an "explicit" leftBarButtonItem. But what if you want your Logo in the Navigation Bar and still have a Back button or a bar on the left?


回答1:


I've used this way before but it seems me like some workaround. I advice you to use your own UIToolBar and hide navigation bar. It's simple. The only what you need is to get image for Back button here http://www.teehanlax.com/downloads/ios-5-gui-psd-iphone-4s/.



来源:https://stackoverflow.com/questions/12568508/custom-view-in-tab-bar-does-no-longer-work-in-ios6

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!