【发布时间】:2012-01-06 03:52:16
【问题描述】:
我正在使用类别来自定义导航栏。我的代码是:
- (void) drawRect:(CGRect)rect {
CGContextRef context = UIGraphicsGetCurrentContext();
CGContextSetFillColor(context, CGColorGetComponents([self.tintColor CGColor]));
CGContextFillRect(context, rect);
}
它工作得很好,但在 iOS 5 中不行。我需要导航栏颜色是纯色的,没有任何渐变。我该怎么做?
据我所知,对于 iOS 5,替换 drawRect 方法的唯一方法是创建一个子类,但有没有办法让所有导航控制器都使用 UINavigationBar 子类而不是原始类?
【问题讨论】:
标签: ios5 uinavigationbar customizing