UISearchDisplayController 表视图的自定义类 [英] Custom class for UISearchDisplayController's table view

查看:21
本文介绍了UISearchDisplayController 表视图的自定义类的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要使 UISearchDisplayController 类中的表格视图成为从 UITableView 扩展的自定义类.

I need to make the table view inside the UISearchDisplayController class to be a custom class which extends from UITableView.

我正在使用这个 pod:https://github.com/OliverLetterer/SLExpandableTableView,但是使用 UISearchBar 和搜索结果时,我似乎无法使其工作.

I'm using this pod: https://github.com/OliverLetterer/SLExpandableTableView, but I can't seem to make it work when using a UISearchBar and search results.

我想用于表格视图的类叫做 SLExpandableTableView,它有几个方法和属性,使子行工作.

The class I want use for the table view it's called SLExpandableTableView and it has several methods and properties which makes subrows work.

提前致谢.

推荐答案

不确定是否可行.我认为问题在于 UISearchDisplayController 为其结果实例化了一个内部 UITableView .您必须子类化并重写它才能使用您的自定义 tableView,但我不建议这样做.

Not sure that's possible. I believe the problem is that UISearchDisplayController instantiates an internal UITableView for its results. You'd have to subclass and rewrite it to use your custom tableView, but I wouldn't recommend that.

在 iOS 8 中,您可以轻松地使用您自己的(自定义)tableView 来搜索结果,但这需要您迁移到较新的 UISearchController.

In iOS 8, you can easily use your own (custom) tableView for search results, but it requires you to migrate to the newer UISearchController.

这篇关于UISearchDisplayController 表视图的自定义类的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆