首页 > 代码库 > 改变导航栏下方默认横线的样式

改变导航栏下方默认横线的样式

用图片替换:

-(void)viewDidLoad{[super viewDidLoad];CALayer *border = [CALayer layer];    border.borderColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"navigationBarUnderline"]].CGColor;    border.borderWidth = 1;    CALayer *layer = self.navigationController.navigationBar.layer;    border.frame = CGRectMake(0, layer.bounds.size.height, layer.bounds.size.width, 2);    [layer addSublayer:border];}

 

改变导航栏下方默认横线的样式