UISearchDisplayController“无结果”文本
可能的重复:
如何更改UISearchDisplayController 的 UISearchBar 中的“取消”按钮、“无结果”标签的字符串?
在我的 UISearchDisplayController 中,我想更改 searchResultsTableView 中出现的“无结果”文本的字体没有可用的结果。
我该怎么做?
Possible Duplicate:
How can I change strings of “Cancel” button, “No Results” label in UISearchBar of UISearchDisplayController?
In my UISearchDisplayController, I want to change the font of the "No Results" text that appears in the searchResultsTableView when no results are available.
How can I do this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您的问题可能与 如何更改 UISearchDisplayController 的 UISearchBar 中的“取消”按钮、“无结果”标签的字符串?
这是对此处给出的答案的修改:
基本上,您要求做的只是访问显示“无结果”文本的 UILabel。没有官方的方法可以做到这一点。正如该页面所建议的,解决方法是查找 UILabel(通过枚举搜索结果表的所有子视图)并修改它。我通常不会鼓励这种事情,但我发现苹果拒绝提供官方方式来应对“无结果”标签是彻头彻尾令人讨厌的,所以在这场特殊的斗争中没有任何保留。
You question may be a duplicate of How can I change strings of "Cancel" button, "No Results" label in UISearchBar of UISearchDisplayController?
Here's a modification of the answer given there:
Basically what you're asking to do is simply to access the UILabel that is displaying the "No Results" text. There is no official way to do that. The workaround, as suggested on that page, is to look for the UILabel (by enumerating all the subviews of the search results table) and modify it. I generally can't encourage this sort of thing, but I find Apple's refusal to supply an official way to grapple with this "No Results" label to be downright obnoxious, so no holds are barred in this particular fight.