我正在嘗試開發iOS應用程序的自定義搜索。導航控制器上的後退按鈕位置
我設法得到出現在搜索控制器和顯示正確的搜索欄,但我唯一的問題是,我需要後退按鈕出現在導航欄,而不是左的權利,請參見下面
(正如你所看到的後退按鈕是在左邊,但我需要的是右側) http://imgur.com/qLPoIfG
這裏是我的代碼:
import UIKit
類SearchTop10Controller:UITableVie wController,UISearchResultsUpdating {
override func viewDidLoad() {
super.viewDidLoad()
let searchController = UISearchController(searchResultsController: self);
self.definesPresentationContext = true;
searchController.searchResultsUpdater = self;
// searchController.hidesNavigationBarDuringPresentation = true;
searchController.dimsBackgroundDuringPresentation = false;
searchController.searchBar.sizeToFit();
self.navigationItem.titleView = searchController.searchBar;
self.tableView.tableHeaderView = searchController.searchBar;
}
override func viewDidAppear(animated: Bool) {
}
func updateSearchResultsForSearchController(searchController: UISearchController) {
//do whatever with searchController here.
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
不要編輯你的代碼,包括您的固定代碼(沒有問題)。通過點擊旁邊的檢查標記將答案提供給解決方案的答案。 – WMios
我會說,如果這是你想要在商店得到的東西蘋果通常是相當違背標準(即它在右邊而不是左邊)。 – Dallas