@interface ELItemController ()
{
UIImageView *navBarHairlineImageView;
}
- (void)viewDidLoad {
//设置导航去掉黑色横线
UINavigationBar *navigationBar = self.navigationController.navigationBar;
navBarHairlineImageView = [self findHairlineImageViewUnder:navigationBar];
}
#pragma mark - 导航横线
- (UIImageView *)findHairlineImageViewUnder:(UIView *)view {
if ([view isKindOfClass:UIImageView.class] && view.bounds.size.height <= 1.0) {
return (UIImageView *)view;
}
for (UIView *subview in view.subviews) {
UIImageView *imageView = [self findHairlineImageViewUnder:subview];
if (imageView) {
return imageView;
}
}
return nil;
}
- (void)viewWillAppear:(BOOL)animated {
[super viewWillAppear:animated];
navBarHairlineImageView.hidden = YES;
}
- (void)viewWillDisappear:(BOOL)animated {
[super viewWillDisappear:animated];
// navBarHairlineImageView.hidden = NO;
}
网友评论