iphone - 如何在 UISearchDisplayController 中将默认文本更改为 "No results"

标签 iphone xcode uisearchbar uisearchdisplaycontroller

我有一个UISearchBar和一个 UISearchBarDisplayController由xib设立。 搜索无结果后,表中某些行显示“无结果”。 如何修改默认文本?

最佳答案

你也可以试试这个。

  1. 在搜索显示 Controller 的 TableView 委托(delegate)/数据源中,将 -numberOfRowsInSection: 抑制为最小值 1。
  2. 然后在 -cellForRowAtIndex: 方法中,如果数据源计数为零,请将 TableView 单元格的标签更改为“正在搜索...”之类的内容

关于iphone - 如何在 UISearchDisplayController 中将默认文本更改为 "No results",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9175941/

相关文章:

iphone - 有什么好的 iPhone 时间线库吗?

c++ - xcode c/c++ 链接器错误 : undefined symbol

ios - 带有 UITableViewController 的 SearchBar 包含错误数量的单元格

ios - 导航栏搜索 View

ios - 保留 UISearchBar 的边距

ios - UITextField 在 UIButton 触摸时退出第一响应者

iphone - 有没有办法在 Xcode 的 resources 文件夹中创建子文件夹?

iPhone SDK NSString 转 NSDate

iphone - UIPicker 的替代品

ios - 运行 cordova build ios --release 时发生错误(退出代码 1)