我正在尝试使用UISearchController
iOS 8 中的新功能,并将其嵌入UISearchBar
到我的UINavigationBar
. 这很容易做到,如下所示:
searchController = UISearchController(searchResultsController: nil)
searchController.searchResultsUpdater = self
searchController.delegate = self
searchController.searchBar.delegate = self
searchController.dimsBackgroundDuringPresentation = false
searchController.hidesNavigationBarDuringPresentation = false
navigationItem.titleView = searchController.searchBar
但是当我添加范围按钮时:
searchController.searchBar.showsScopeBar = true
searchController.searchBar.scopeButtonTitles = ["Posts, Users, Subreddits"]
它在后面添加了按钮UISearchBar
,显然看起来很奇怪。
我应该怎么做?