草庐IT

uisearchresultscontroller

全部标签

iphone - 我如何在带有搜索结果 Controller 的 Storyboard 中使用原型(prototype)单元

当在搜索栏中搜索时,我有带有搜索结果Controller的tableview出现此错误,表明没有单元格并出现以下错误。如何创建我的prototype单元格在这个方法中CellForRowAtIndexPath代码:-(UITableViewCell*)tableView:(UITableView*)tableViewcellForRowAtIndexPath:(NSIndexPath*)indexPath{staticNSString*CellIdentifier=@"HoCell";Ho*cell;Ho*item;if(tableView==self.searchDisplayCon

ios - 使用 UISearchDisplayController 时,UICollectionView 中的 UISearchBar 消失

我将UISearchBar添加为UICollectionView的subview,并附加到UISearchDisplayController。我在viewDidLoad中设置:self.searchController=[[UISearchDisplayControlleralloc]initWithSearchBar:self.searchBarcontentsController:self];self.searchController.delegate=self;self.searchController.searchResultsDataSource=self;self.sear

ios - updatesearchresultsforsearchcontroller 未调用

有谁知道为什么这里没有被调用?谢谢。我想我正确地设置了代表。classLocationSearchController:UIViewController,UISearchResultsUpdating,UINavigationBarDelegate,UISearchControllerDelegate{letnavigationBar=UINavigationBar(frame:CGRect(x:0,y:0,width:UIScreen.mainScreen().bounds.width,height:44))varlocationSearchController:UISearchCo

ios - 呈现搜索结果 Controller 时 UISearchBar 的高度不正确

我在tableView的标题View中有一个搜索栏,我没有更改它的高度(默认为56pt)。当搜索栏处于事件状态并且其位置位于屏幕顶部时,它的高度变为50pt。这都会发生在iPhone或模拟器,版本iOS11上。首次出现:;layer=>编辑:;layer=>这会导致搜索栏和结果Controller的View之间出现奇怪的间隙。感谢您的任何想法。编辑1:这是我的代码:fileprivatefuncconfigSearchBar()->Void{letbar=self.searchBarvarsize=bar.frame.sizeletstatusBarHeight=UIApplicati

Swift UISearchController 在核心数据项目中连接,应用程序运行,但搜索不更新

过去几天,我一直在努力在Swift项目中为使用CoreData的TableViewController创建过滤器。我终于发现我需要使用UISearchController,为searchController.searchBar创建一个NSPredicate,等等。我找到了thispostEXTREMELYhelpful,但是在这个项目之后为我的TVC建模后,我发现“所有的灯都亮着,但没人在家”。我可以搜索,谓词是在searchBar中创建的,添加、删除等,但单元格不会针对搜索进行更新。我错过了什么,但我不知道是什么。这是我的代码的相关部分。classMasterViewControll

Swift UISearchController 在核心数据项目中连接,应用程序运行,但搜索不更新

过去几天,我一直在努力在Swift项目中为使用CoreData的TableViewController创建过滤器。我终于发现我需要使用UISearchController,为searchController.searchBar创建一个NSPredicate,等等。我找到了thispostEXTREMELYhelpful,但是在这个项目之后为我的TVC建模后,我发现“所有的灯都亮着,但没人在家”。我可以搜索,谓词是在searchBar中创建的,添加、删除等,但单元格不会针对搜索进行更新。我错过了什么,但我不知道是什么。这是我的代码的相关部分。classMasterViewControll