导航控制器-自定义导航栏

设置颜色用settintcolor

也可以直接设置背景图片。

UIImage *image = [UIImage imageNamed:@"title"];
[self.navigationController.navigationBar setBackgroundImage:image forBarMetrics:UIBarMetricsDefault];

 但是在5.0之前是不能直接设置背景图片。需要定义一个分类,重写drawrect方法

分类函数的执行优先级更高

调用方法时候进行版本判断

 

 

posted on 2013-10-03 21:21  老猫zl  阅读(235)  评论(0编辑  收藏  举报