UISearchDisplayController 去除“No Results”,“无结果” 的显示方法
2012-03-23 12:35
417 查看
UISearchDisplayController 去除“No Results” 的显示方法
实现此delegate方法就可以了,如果是中文添加一个判断[[(UILabel*)v text] isEqualToString:@"无结果"] 就ok了
-(BOOL)searchDisplayController:(UISearchDisplayController *)controller
shouldReloadTableForSearchString:(NSString *)searchString {
dispatch_time_t popTime = dispatch_time(DISPATCH_TIME_NOW, 0.001);
dispatch_after(popTime, dispatch_get_main_queue(), ^(void){
for (UIView* v in self.sbc.searchResultsTableView.subviews) {
if ([v isKindOfClass: [UILabel class]] &&
[[(UILabel*)v text] isEqualToString:@"No Results"]) {
// .. do whatever you like to the UILabel here ..
break;
}
}
});
return YES;
}
实现此delegate方法就可以了,如果是中文添加一个判断[[(UILabel*)v text] isEqualToString:@"无结果"] 就ok了
-(BOOL)searchDisplayController:(UISearchDisplayController *)controller
shouldReloadTableForSearchString:(NSString *)searchString {
dispatch_time_t popTime = dispatch_time(DISPATCH_TIME_NOW, 0.001);
dispatch_after(popTime, dispatch_get_main_queue(), ^(void){
for (UIView* v in self.sbc.searchResultsTableView.subviews) {
if ([v isKindOfClass: [UILabel class]] &&
[[(UILabel*)v text] isEqualToString:@"No Results"]) {
// .. do whatever you like to the UILabel here ..
break;
}
}
});
return YES;
}
相关文章推荐
- 使用UISearchDisplayController显示搜索结果
- 解决UISearchDisplayController搜索结果滚动时,顶部透明的问题
- 自定义UISearchDisplayController中搜索到结果的cell的位置
- UISearchBar和UISearchDisplayController键盘bookmark.search等事件的方法
- UISearchDisplayController “No Results“和 cancel按...
- UISearchDisplayController “No Results“ cancel修改
- UISearchDisplayController “No Results“ cancel修改
- ios笔记之- UISearchDisplayController 无搜索结果下的文字定义
- UISearchDisplayController “No Results“ cancel修改
- UISearchDisplayController(iOS < 8.0)实例应用实现搜索功能和VC展示效果, 以及代理方法的介绍
- Swift - 带结果列表的搜索条(UISearchDisplayController)的用法
- 解决UISearchDisplayController 在消失后显示navigationController.navigationBar的问题
- IOS:自定义UISearchDisplayController的cancel和no results
- UISearchDisplayController “No Results“ cancel修改
- How do I cover the “no results” text in UISearchDisplayController's searchResultTableView?
- UISearchBar和UISearchDisplayController
- UISearchDisplayController详解
- UISearchDisplayController搜索时总是报cell错
- UISearchDisplayController
- UISearchDisplayController搜索(iOS8前)