84669 personnes étudient
152542 personnes étudient
20005 personnes étudient
5487 personnes étudient
7821 personnes étudient
359900 personnes étudient
3350 personnes étudient
180660 personnes étudient
48569 personnes étudient
18603 personnes étudient
40936 personnes étudient
1549 personnes étudient
1183 personnes étudient
32909 personnes étudient
将以下方法放在UISearchBarDelegate代理方法或者UISearchDisplayControllerdelegate代理方法中:
1)如果你想改掉这个字符,换为自己想要的字符串的话可以试试:
for (UIView *subView in self.searchDisplayController.searchResultsTableView.subviews) { if ([subView isKindOfClass:NSClassFromString(@"UILabel")]) { UILabel *label =(UILabel *)subView; label.text = @"自定义字符串"; } }
2) 如果单纯想覆盖掉这段文字的话,我用过的最好的方法是:
for (UIView *subView in self.searchDisplayController.searchResultsTableView.subviews) { if ([subView isKindOfClass:NSClassFromString(@"UILabel")]) { UILabel *label =(UILabel *)subView; //自定义一个View CGFloat ViewWidth = [UIScreen mainScreen].bounds.size.width*0.64; CGFloat ViewHeight = ViewWidth*0.75; tempNoResultView = [[UIView alloc]init]; tempNoResultView.size = CGSizeMake(ViewWidth, ViewHeight); tempNoResultView.center = CGPointMake([UIScreen mainScreen].bounds.size.width/2, heightToTop); tempNoResultView.backgroundColor = [UIColor whiteColor]; [label addSubview:_tempNoResultView]; } } //相当于遍历出这个label,用一个View把“No Result”遮盖掉。只有这个方法虽然很low但是works well,用其他的方法并不稳定,因为并不建议修改这些东西而且UISearchDisplayController是个坑,这也是为什么后来苹果放弃UISearchDisplayController的原因。
没有数据的时候会出现,设置一个dummy cell即可。
无数据时,设置一个空白 cell。。这样处理。。
将以下方法放在UISearchBarDelegate代理方法或者UISearchDisplayControllerdelegate代理方法中:
1)如果你想改掉这个字符,换为自己想要的字符串的话可以试试:
2) 如果单纯想覆盖掉这段文字的话,我用过的最好的方法是:
没有数据的时候会出现,设置一个dummy cell即可。
无数据时,设置一个空白 cell。。这样处理。。