2012-10-10 187 views
0

我有一個UITable爲了在一些數據(時區)之間搜索。我的問題是,當疊加視圖出現時,索引仍然顯示。搜索時從UITableView中刪除索引

如下圖所示,「?」字符被顯示並且索引可以被啓用。搜索時是否可以禁用它並且疊加層被激活?怎麼樣?

enter image description here

回答

0

sectionIndexTitlesForTableView回報nil當你的搜索欄被激活。

0

從頂部

+0

這是怎麼完成的? – cateof

+0

從您的ViewContoller的xib – Apple

0

你使用UISearchDisplayController降低您的UITableView的高度?

- (NSArray *)sectionIndexTitlesForTableView:(UITableView *)tableView { 
    return (([[self.fetchedResultsController sectionIndexTitles] count] > 5) ? [self.fetchedResultsController sectionIndexTitles]:nil); 
} 

我顯示它,當我有超過5個結果

而且這是UITableViewDataSource的方法。你需要實現和頭指定執行前:

UITableViewController<NSFetchedResultsControllerDelegate, UISearchBarDelegate, UISearchDisplayDelegate> 
0

當搜索表格視圖顯示時,是否刷新基礎tableview? 如果你是,試着阻止它。我有一個類似的問題,我可以通過這種方式解決。