searchHarをtableHeaderViewの中に配置しました。 すべてがiphone 6ではうまく動作しますが、iphone 5sではこの奇妙な結果が得られますか?searchBarがセクションヘッダービューでオーバーラップしました
override func viewDidLoad() {
super.viewDidLoad()
tableView.delegate = self
tableView.dataSource = self
tableView.sectionIndexColor = Constants.Colors.ThemeGreen
tableView.sectionIndexBackgroundColor = UIColor.clearColor()
tableView.sectionIndexTrackingBackgroundColor = UIColor.clearColor()
tableView.contentInset = UIEdgeInsetsMake(0, 0, CGFloat(Constants.Dimensions.TabBarHeight), 0)
resultSearchController = UISearchController(searchResultsController: nil)
resultSearchController.searchResultsUpdater = self
resultSearchController.dimsBackgroundDuringPresentation = false
resultSearchController.definesPresentationContext = true
tableView.tableHeaderView = resultSearchController.searchBar
resultSearchController.searchBar.sizeToFit()
//Fetch data for the first time
do{
try fetchedResultsController.performFetch()
listHeaderView?.count = "\(fetchedResultsController.fetchedObjects!.count)"
}catch{
print("Error - Couldn't fetch list")
}
- 注:私はデータ
追加する前にsizeToFitを呼び出した後でも私はまだこの問題に直面しています –