iphone - 禁用添加到 UITableView 的 UISearchbar 的滚动

标签 iphone uitableview uisearchbar

我已将 UISearchBAr 添加到 UITableView 来实现搜索功能。

但是搜索完成后,UISearchBar 也会随着 UITableView 一起滚动并消失。我只是想知道如何使搜索栏静态而仅 UITableView 滚动...

最佳答案

我假设您将 searchBar 添加到 tableView 的 headerView 中,这就是它与表格的其余部分一起滚动的原因。尝试将 searchBar 添加到 View (而不是 tableView)中,并将 tableView 的框架大小调整为位于 searchBar 下方。

关于iphone - 禁用添加到 UITableView 的 UISearchbar 的滚动,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3759389/

相关文章:

iphone - 有人可以给我展示 View Controller 如何工作的图表吗?

iphone - 将多个图像添加到哪种数组的最佳方法?

ios - 应用程序打开 wkwebview,无法滚动并等待 3 秒应用程序崩溃

iphone - 在 uitableview 中删除行

swift - UITableView didSelectRowAtIndexPath 获取所选部分的实例

ios - 屏幕挂起并终止

uitableview - 专注于 UISearchBar 但键盘没有出现

iphone - PhoneGap 安装和创建基于 PhoneGap 的应用程序

swift - 使用 UISearchResultsUpdating 过滤表格 View

iOS 7.1 : Border around search bar