2012-03-10 6 views
3

iOS5のmy tableviewコントローラのプロトタイプセルにある同じスタイル(高さ、背景など)の検索結果コントローラテーブルビューでの方法があります。 ?プロトタイプのカスタムセルと検索ディスプレイコントローラのテーブルビューを持つUITableViewコントローラ

ルートビューには背景画像と特定のセルの高さがあります。検索テーブルが背景画像で表示されず、セルの高さが低くなります。

+2

実際は簡単でした。 だけ使用 - (無効)searchDisplayController:(UISearchDisplayController *)コントローラdidLoadSearchResultsTableView:(のUITableView *)のtableView { とそこスタイリングコードを置きます –

答えて

4

別の方法は、単に同一のセル識別子を使用することである(少なくともあなたがストーリーボードを使用している場合)、そう例えば:そのような行の高さ等の特性にアクセスすることによって設定することができるよう

static NSString *CellIdentifier = @"searchCell"; 
myCustomCell *cell = (myCustomCell *)[tableView dequeueReusableCellWithIdentifier:CellIdentifier]; 

//for search controller need to check if cell is nil, if it is create one since there won't be any to reuse to begin with 
if (!cell) { 
    cell = (myCustomCell *)[self.tableView dequeueReusableCellWithIdentifier:CellIdentifier]; 
    [cell setAccessoryType:UITableViewCellAccessoryDisclosureIndicator]; 
} 

他の特性

関連する問題