With UISearchdisplayController,this would be simple: create a UISearchbar and add it to a custom UICollectionVIEw section header,then initialize the UISearchdisplayController with the search bar
UISearchController中的搜索栏是为您创建的.在数据源方法中询问补充视图时
- (UICollectionReusableVIEw *)collectionVIEw:(UICollectionVIEw *)collectionVIEw vIEwForSupplementaryElementOfKind:(Nsstring *)kind atIndexPath:(NSIndexPath *)indexPath
添加searchController.searchbar作为补充视图的子视图.别忘了打电话
[searchController.searchbar sizetoFit]
为了给搜索栏适当的大小.
总结以上是内存溢出为你收集整理的ios – UICollectionView不能使用UISearchController?全部内容,希望文章能够帮你解决ios – UICollectionView不能使用UISearchController?所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)