【问题标题】:Using UISearchDisplayController in a child controller在子控制器中使用 UISearchDisplayController
【发布时间】:2014-04-29 07:10:00
【问题描述】:
我制作了一个选项卡式控制器,其中选项卡位于顶部。在选项卡下方,我有一个子视图,其中包含一个 tableViewController 作为子控制器。
tableViewController 有一个 searchBar 和一个 UISearchDisplayController。问题是,当搜索被激活时,UISearchDisplayController 会突出到 tableView 的框架之上并覆盖一些选项卡。
我相信这是由于 SearchBar 在顶部扩展自身以覆盖导航栏造成的。
【问题讨论】:
标签:
ios
uisearchdisplaycontroller
【解决方案1】:
抱歉,您为什么要使用搜索显示控制器?
在这种情况下,如果您使用 只是一个带有 searchBar 的 tableView 以及您的选项卡,则会更容易。
然后您可以开发与searchDisplayController 相同的行为。
有些开发者从未使用过searchDisplayController。一般来说,我只是在我有一个 tableViewController 时才使用它,所以只有一个 tableView 和一个 searchBar。但在你的情况下,我不会使用它。相信我,让你的生活更轻松;)