iOS 隐藏navigationBar底部线条

override func viewDidLoad() {

super.viewDidLoad()

if let line = findHairlineImageViewUnder(view: self.navigationBar) {

line.isHidden = true

}

}

func findHairlineImageViewUnder(view: UIView) -> UIImageView? {

if view is UIImageView && view.bounds.size.height <= 1.0 {

return view as? UIImageView

}

for subview in view.subviews {

let imageView = findHairlineImageViewUnder(view: subview)

return imageView

}

return nil

}

你可能感兴趣的:(iOS 隐藏navigationBar底部线条)