【发布时间】:2011-06-24 18:24:35
【问题描述】:
我想在我的 UITableView 顶部有一个 UISearchBar,当您向下滚动时它隐藏:答案很简单,我只需要将它添加到我的表格视图标题中,如下所示:
UISearchBar *search = [[UISearchBar alloc] initWithFrame:CGRectMake(0, 0, 320, 45)];
self.tableView.tableHeaderView = search;
[search release];
但问题是,当您向上滚动 UISearchBar 适合 UITableView 的顶部,而不是 UINavigationBar 的顶部。更清楚地说,我在 Mail(不好)和 Game Center(好)中做了一个屏幕。
我想要和 Game Center 中的一样。你知道他们是怎么做到的吗?
【问题讨论】:
标签: iphone ios uitableview uiscrollview uisearchbar