ios 5 上如何定制导航条风格

In iOS 5, the UINavigationBarUIToolbar, and UITabBar implementations have changed so that the drawRect: method is not called unless it is implemented in a subclass. Apps that have re-implemented drawRect: in a category on any of these classes will find that the drawRect: method isn't called. UIKit does link-checking to keep the method from being called in apps linked before iOS 5 but does not support this design on iOS 5 or later. Apps can either:

  • Use the customization API for bars in iOS 5 and later, which is the preferred way.

  • Subclass UINavigationBar (or the other bar classes) and override drawRect: in the subclass.


你可能感兴趣的:(ios,api)