iphone开发 UINavigationBar贴图

来源:互联网 发布:高斯混合模型 知乎 编辑:程序博客网 时间:2024/05/17 03:23

UINavigationBar可以更改颜色,自然可以重写drawRect函数来贴图:

@implementation UINavigationBar (MyNavigationBarAdditions)- (void)drawRect:(CGRect)rect {UIImage *img  = [UIImageimageNamed:@"rednav.png"];[img drawInRect:CGRectMake(0,0, self.frame.size.width,self.frame.size.height)];}@end

原创粉丝点击