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