开发者

UIImagePicker's UINavigationBar is abiding to drawRect. How can I stop this?

I am using the following code to set the backgrounds of all UINavigationBars in my application. However, when I load the UIImagePicker, its' UINavigationBar will have the same backgroundView as all of the other UINavigationBars in my application.

How开发者_如何学运维 could I prevent this from happening?

@implementation UINavigationBar (UINavigationBarCategory)

- (void) drawRect:(CGRect)rect {
    [[UIImage imageNamed:@"NavBarSocial.png"] drawInRect:rect];
}
@end


I had the same problem and i fixed it by using the following code in my drawRect method

UIColor *color = [UIColor blackColor];
UIImage *img  = [UIImage imageNamed: @"NavigationBarBackground.png"];
[img drawInRect:CGRectMake(0, 0, self.frame.size.width, self.frame.size.height)];
self.tintColor = color;
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜