0

请告诉我我们如何实现这一点。顶部的搜索栏之后有一个表格视图。在一个表格中有部分标题和索引值。当我们滚动表格并且索引值(A、B、C、D、E 等)在搜索栏上方时,搜索栏是恒定的。

4

1 回答 1

0
This will give you standard searchBar and solve your problem.

UISearchBar *searchBar = [[UISearchBar alloc] initWithFrame:CGRectZero];
[searchBar sizeToFit];
searchBar.delegate = self;
searchBar.placeholder = @"Search";
self.tableView.tableHeaderView = searchBar;

UISearchDisplayController *searchDC = [[UISearchDisplayController alloc] initWithSearchBar:searchBar contentsController:self];
于 2013-07-02T16:32:43.883 回答