我已将 UISearchBAr 添加到 UITableView 来实现搜索功能。
但是搜索完成后,UISearchBar 也会随着 UITableView 一起滚动并消失。我只是想知道如何使搜索栏静态而仅 UITableView 滚动...
最佳答案
我假设您将 searchBar 添加到 tableView 的 headerView 中,这就是它与表格的其余部分一起滚动的原因。尝试将 searchBar 添加到 View (而不是 tableView)中,并将 tableView 的框架大小调整为位于 searchBar 下方。
关于iphone - 禁用添加到 UITableView 的 UISearchbar 的滚动,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3759389/