self.definesPresentationContext = YES; ----- _searchController = [[UISearchController alloc]initWithSearchResultsController:nil]; _searchController.dimsBackgroundDuringPresentation = NO; _searchController . hidesNavigationBarDuringPresentation = NO; _searchController.searchBar.frame = CGRectMake(self.searchController.searchBar.frame.origin.x, self.searchController.searchBar.frame.origin.y, self.searchController.searchBar.frame.size.width, 44.0); _searchController.searchBar.placeholder=@"搜索店铺地址"; _searchController.searchBar.returnKeyType = UIReturnKeySearch; _searchController.searchBar.delegate = self;; _tbvw.tableHeaderView = self.searchController.searchBar; self.definesPresentationContext = YES;
转载于:https://www.cnblogs.com/marysneaker/p/5826186.html