1
当我单击搜索按钮(如Twitter应用程序中的搜索按钮)时,如何让我的搜索栏在导航栏中展开?现在我的搜索栏只是在导航栏的顶部。这是我打电话的时候,我在导航栏中点击搜索按钮的功能:搜索栏从iphone上的搜索按钮扩展
func searchbuttonclicked(sender: UIBarButtonItem) {
var searchresults = storyboard?.instantiateViewControllerWithIdentifier("searchresults") as searchResultsController
var searchcontroller = UISearchController(searchResultsController: searchresults)
searchcontroller.hidesNavigationBarDuringPresentation = false
searchcontroller.searchResultsUpdater = searchresults
searchcontroller.modalTransitionStyle = .CrossDissolve
presentViewController(searchcontroller, animated: true, completion: nil)
}
谢谢你的帮助 – jk3455 2014-11-04 06:59:13