2016-12-22 44 views
0

enter image description here搜索欄UISearchController的是躺在下狀態欄,當活性物

let storyboard = UIStoryboard(name: "ProductSearch_iPhone", bundle: nil) 
    let controller : RSearchResultController = storyboard.instantiateViewController(withIdentifier: "SResult") 
               as! RSearchResultController 

    searchController      = UISearchController(searchResultsController:controller) 
    searchController.searchResultsUpdater = controller 
    searchController.dimsBackgroundDuringPresentation = true 
    controller.delegate         = self 
    searchController.searchBar.delegate     = controller 
    self.present(searchController, animated: true, completion: nil) 
    definesPresentationContext = true 

我已經不整合的UITableView像許多其他教程添加UISearchController(IOS 9.3,IOS 8.4)。

回答

0

最後,我找到了解決方案。問題不是設備特定的,ios 9和ios8顯示破壞設計,而在ios10中很好。

definesPresentationContext = true 

上面的代碼行是問題,這是寫在意圖搜索欄不應該存在當我導航到某處&復出而UISearchController是活動的。但根據我的要求,我沒有選擇導航UISearchController處於活動狀態。

相關問題