2012-07-27 105 views
1

我有一个表格视图,单元格高度是70.im使用搜索栏..但问题是由搜索栏的高度提供的默认表视图不能够增加..有没有任何代表方法...反对你们帮我下面是代码。增加搜索栏表格视图单元格的高度

-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath 
{ 
if (tableView == self.tableViewFriendsList) { 
return 70; 
} 
if (tableView == searchDisplayController.searchResultsTableView) { 
    return 70; 
} 

} 

回答

1

只要searchResultsDelegate设置正确(通常设置为self),它应该没有问题。我只是Apple`s TableSearch示例代码尝试过了,只是增加

- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath 
{ 
    return 70.; 
} 

和两个表视图和搜索表视图中使用新的高度的细胞。

+0

感谢你的努力。我已经找到了answer..its其实这delegate..that工作...-(无效)searchDisplayController:(UISearchDisplayController *)控制器 willShowSearchResultsTableView:(UITableView的*)的tableView { NSLog(@“我来到这个地方”); [tableView setRowHeight:70]; [tableView reloadData]; } – user578386 2012-07-28 05:21:59

相关问题