取消iOS10和iOS9以下导航栏黑线
Posted 建古
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了取消iOS10和iOS9以下导航栏黑线相关的知识,希望对你有一定的参考价值。
if ([self.navigationController.navigationBar respondsToSelector:@selector( setBackgroundImage:forBarMetrics:)])
NSArray *list=self.navigationController.navigationBar.subviews;
for (id obj in list)
if ([UIDevice currentDevice].systemVersion.floatValue >= 10.0)
//10.0的系统字段不一样
UIView *view = (UIView*)obj;
for (id obj2 in view.subviews)
if ([obj2 isKindOfClass:[UIImageView class]])
UIImageView *image = (UIImageView*)obj2;
image.hidden = YES;
else
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;
以上是关于取消iOS10和iOS9以下导航栏黑线的主要内容,如果未能解决你的问题,请参考以下文章