0
我想構建一個像地圖應用程序一樣的搜索控件;搜索將在iPhone上打開一個結果tableview(這可以正常工作),並且應該在iPad上的彈出窗口中打開一個tableview。這曾經在UISearchDisplayController
自動,但不再工作,它顯示在iPad上的全屏桌面視圖。UISearchController顯示全屏而不是iPad上的彈出框
self.resultsController = [[EFResultTableViewController alloc] init];
[self.resultsController.tableView setDelegate:(id<UITableViewDelegate>)self];
self.searchController =
[[UISearchController alloc] initWithSearchResultsController:self.resultsController];
[self.searchController setSearchResultsUpdater:(id<UISearchResultsUpdating>)self];
self.searchController.dimsBackgroundDuringPresentation = NO;
self.searchController.hidesNavigationBarDuringPresentation = NO;
[self.searchController.searchBar setBarTintColor:[UIColor whiteColor]];
[self.searchController.searchBar setDelegate:(id<UISearchBarDelegate>)self];
self.definesPresentationContext = YES;
ResultTableViewController
只是一個自定義的tableview。我不想寫IS_IPAD
有條件的代碼。有什麼我在這裏失蹤。