ios 5.0中关于UINavigationBar, UIToolbar, and UITabBar - drawRect:调用问题

来源:互联网 发布:中国指数研究院数据库 编辑:程序博客网 时间:2024/05/18 09:25
In iOS 5, the UINavigationBar, UIToolbar, 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.

//原文地址 http://blog.csdn.net/diyagoanyhacker/article/details/6876543

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


通过官方的说法我们可以看出:- drawRect:只有定义在它们的子类中才会被执行.并且ios5 也定义了设置背景的API。

原创粉丝点击