为没有UISearchBar的UITableViewController设置UISearchDisplayController

时间:2014-04-25 20:21:34

标签: ios uisearchbar uisearchdisplaycontroller

我发现构建UISearchDisplayController的唯一方法是在UISearchBar上构建UITableViewController

但是,我不希望UISearchBar显示,并希望通过按下按钮启动搜索。

这可能吗?

我尝试按下按钮上的UISearchDisplayController

- (void)searchButtonPressed:(id)sender{
  [self.searchDisplayController setActive:YES animated:YES];
}

此"有效",但显示的searchDisplayController没有UISearchBar。 (明显)。

1 个答案:

答案 0 :(得分:0)

我最终只将hidden字段设置为NO,并在显示和关闭搜索显示控制器时将其设置为YES。

相关问题