zoukankan      html  css  js  c++  java
  • iOS 单个控制器隐藏 导航栏下划线

    - (void)useMethodToFindBlackLineAndHindWithHidden:(BOOL)hidden{
        
        UIImageView* blackLineImageView = [self findHairlineImageViewUnder:self.navigationController.navigationBar];
        //隐藏黑线(在viewWillAppear时隐藏,在viewWillDisappear时显示)
        blackLineImageView.hidden = hidden;
    }
    - (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];
        //隐藏黑线
        [self useMethodToFindBlackLineAndHindWithHidden:YES];
    }
    
    - (void)viewWillDisappear:(BOOL)animated {
        [super viewWillDisappear:animated];
        ///显示黑线
        [self useMethodToFindBlackLineAndHindWithHidden:YES];
    }
  • 相关阅读:
    作业3.14下
    作业3.14上
    作业3.13 下
    作业 3.13上
    2017.3.10上午
    2017.3.9上午
    2017.3.23-morning
    2017.3.22-morning
    2017.3.21-afternoon
    2017.3.21-morning
  • 原文地址:https://www.cnblogs.com/qingzZ/p/14366732.html
Copyright © 2011-2022 走看看