How to hide UINavigationBar 1px bottom line

后端 未结 30 2173
不知归路
不知归路 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:41

    In iOS8, if you set the UINavigationBar.barStyle to .Black you can set the bar's background as plain color without the border.

    In Swift:

    UINavigationBar.appearance().translucent = false
    UINavigationBar.appearance().barStyle = UIBarStyle.Black
    UINavigationBar.appearance().barTintColor = UIColor.redColor()
    

提交回复
热议问题