2017-10-18 106 views
0

如何删除iOS 11上的UISearchController下的行?如何删除iOS 11上的UISearchController下的行?

我已经添加了UISearchController使用此代码:如何删除行

enter image description here

任何意见:

navigationItem.searchController = searchController 

,但这样做有其下一个奇怪的行之后或者至少选择它的颜色将不胜感激。

+0

我认为这是所谓的'hairline'。搜索这个词,你会发现各种解决方案。 – Koen

回答

1

哈克解决方案,但我目前拥有的最好的,是将重叠的暗线被白线图:

let lineView = UIView(frame: CGRect(x: 0, y: searchController.searchBar.frame.height-4, width: view.bounds.width, height: 1)) 
lineView.backgroundColor = .white 
searchController.searchBar.addSubview(lineView) 
相关问题