3种方法:
1.大杀器 ,iOS 10.2 最新系统亲测无问题( 添加导航栏分类)
https://github.com/samwize/UINavigationBar-Addition/
2.ios 7 以上 ,ios 10.2 以下 可用, 不支持最新IOS 系统 (遍历黑线,隐藏)
p.p1 { margin: 0.0px 0.0px 0.0px 0.0px; font: 14.0px Menlo; color: #587ea8 }
p.p2 { margin: 0.0px 0.0px 0.0px 0.0px; font: 14.0px Menlo }
span.s1 { color: #000000 }
span.s2 { color: #35568a }
span.s3 { }
span.s4 { color: #c35900 }
span.s5 { color: #587ea8 }
if ([self.navigationController.navigationBar respondsToSelector:@selector( setBackgroundImage:forBarMetrics:)]){
NSArray *list=self.navigationController.navigationBar.subviews;
for (id obj in list) {
if ([obj isKindOfClass:[UIImageView class]]) {
UIImageView *imageView=(UIImageView *)obj;
NSArray *list2=imageView.subviews;
for (id obj2 in list2) {
if ([obj2 isKindOfClass:[UIImageView class]]) {
UIImageView *imageView2=(UIImageView *)obj2;
imageView2.hidden=YES;
}
}
}
}
}
3.大杀器 但不适用于某些场景(局部可用,与系统版本无关,均有效)
p.p1 { margin: 0.0px 0.0px 0.0px 0.0px; font: 14.0px Menlo; color: #cf8724 }
span.s1 { }
self.navigationController.navigationBar.clipsToBounds = YES;