我把我的 UISearchBar
作为导航栏的一部分,比如:
let searchBar = UISearchBar()
//some more configuration to the search bar
.....
navigationItem.titleView = searchBar
在更新到 iOS 11
之后,我的应用程序中的搜索栏发生了一些奇怪的事情。在 iOS 10
和之前我有我的导航栏看起来像:
现在有了 iOS 11
:
正如你所看到的,这两个搜索栏的四舍五入是不同的,这并不困扰我。问题是搜索栏增加了导航栏的高度。因此,当我使用另一个控制器时,它看起来也很奇怪:
事实上,奇怪的黑线的高度加上当前导航条的高度等于第二张图片中显示的导航条的高度..。
有什么办法可以去掉黑线,并在所有视图控制器上保持导航栏的高度一致?