我正在使用searchBar作为tableView的过滤器。 我在几篇帖子中读过,包括
self.definesPresentationContext = true
解散searchBar,但这不是我的情况。 我想要实现的是,只要用户点击栏,它就会在没有满足某些条件的情况下解除关闭它的搜索。
我也试过
searchController.active = false
没有结果。有人可以帮忙吗?感谢
答案 0 :(得分:1)
尝试:
[searchController.searchBar setHidden:YES];
您可能还想要关闭presentViewController。
尽管马特指出,这是一种奇怪的做法。如果条件不满足甚至不显示searchBar,最好显示alertView。