min*_*pop 12 iphone objective-c uitableview uisearchbar
我有一个可搜索的tableview,但是只想显示用户开始搜索后返回的单元格数.例如,如果用户键入charecter并且只有一个单元格与搜索匹配,则剩余单元格表格的剩余单元格为空.我想知道是否有办法隐藏那些空单元格.我还想知道如果一个人的搜索与任何数据都不匹配,是否有办法隐藏表视图(默认情况下,它会显示一个空单元格表,表示"无结果").
谢谢.
Tom*_*ift 61
设置tableFooterView
为一些虚拟视图([[UIView new] autorelease]
将正常工作).这会提示UITableView
显示页脚(其大小为零)代替空的"单元格".
yun*_*nas 23
- (void) viewDidLoad
{
[super viewDidLoad];
*// self.tableView.tableFooterView = [[[UIView alloc] init] autorelease];*
*//Since memory management is controlled by ARC now, so ignore autorelease*
self.tableView.tableFooterView = [[UIView alloc] init] ;
}
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
17862 次 |
最近记录: |