2013-04-02 22 views
0

我使用自定義的細胞與故事板高度設置爲57iOS6的,故事:UISearchDisplayController返回錯誤的定製UICell高度

enter image description here

而在搜索的tableView,UISearchDisplayController回報我的自定義單元格但高度是錯誤的。

enter image description here

代碼:

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath 
{ 
static NSString *CellReuseIdentifier = @"Cell"; 
CommemorativeItemCell *cell =[self.tableView dequeueReusableCellWithIdentifier:CellReuseIdentifier]; 

KmCell *kmCell=nil; 

if(tableView==self.searchDisplayController.searchResultsTableView) 
{ 
    kmCell=[self.filteredResult objectAtIndex:[indexPath row]]; 
} 
else 
{ 
    kmCell=[self.arr objectAtIndex:[indexPath row]]; 
} 

// bla bla filling up and drawing labels... 

return cell; 
} 

如何使UISearchDisplayController返回到相同的高度的細胞?先謝謝你。

回答

2

你有沒有嘗試設置在viewDidLoad中的搜索結果中單元格的高度與

self.searchDisplayController.searchResultsTableView.rowHeight = 100; 
+0

謝謝亞當您可以返回數。解決的方法非常明顯... – NCFUSN

+0

不用擔心,樂於幫忙! – adamweeks

1

嘗試此方法這可能會幫助你!

,只要你想,而不是110 例如我用110

- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath 
{ 
    return 110; 
} 
相關問題