UINavigationBar.appearance()。shadowImage = swift 4中的UIImage()

时间:2017-09-22 06:20:21

标签: swift4 xcode9 xcode9-beta xcode9beta6

如何在swift 4或xcode 9中实现此代码?

// Remove hairline between navigation bar and anything below such as search bar
UINavigationBar.appearance().shadowImage = UIImage()

我想删除navBar下划线。

2 个答案:

答案 0 :(得分:0)

请检查:

self.navigationController?.navigationBar.shadowImage = UIImage()

答案 1 :(得分:0)

不用担心复制粘贴会起作用。

// Remove Bottom Shadow
UINavigationBar.appearance().shadowImage = UIImage()
UINavigationBar.appearance().setBackgroundImage(UIImage(), for: .default)