I’ve overrided(placed in category, or swizzled) UINavigationBar’s drawRect to show custom background. In iOS 5 it’s not working. What should I do?
I’ve overrided(placed in category, or swizzled) UINavigationBar’s drawRect to show custom background. In iOS
Share
There’s some possible solutions:
Quickest fix For laziest of us :
Again. It works, but You shouldn’t do it like this.
Another way, as suggested in WWDC’11 is to override UINavigationBar (Create MyNavigationBar) and initialize UINavigationController from xib like here :
And finally, use logic flow switch for iOS5.0 and iOS5.0-
Use new API where it’s possible.
Categories is wrong path, Swizzling is wrong path. (They’re just whispering in your ears:”Give yourself to the Dark Side. It is the only way you can save your apps.”)