How to hide UINavigationBar 1px bottom line

后端 未结 30 2508
不知归路
不知归路 2020-11-22 08:58

I have an app that sometimes needs its navigation bar to blend in with the content.

Does anyone know how to get rid of or to change color of this annoying little ba

30条回答
  •  野性不改
    2020-11-22 09:17

    You should add a view to a bottom of the UISearchBar

    let rect = searchController.searchBar.frame;
    let lineView : UIView = UIView.init(frame: CGRect.init(x: 0, y: rect.size.height-1, width: rect.size.width, height: 1))
    lineView.backgroundColor = UIColor.init(hexString: "8CC73E")
    searchController.searchBar.addSubview(lineView)
    

提交回复
热议问题