- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section
を使用してテーブルビューのセクションのカスタムビューを作成しましたが、ボタンがセクションiamの再ロードテーブルビューでタップされたときにカスタムビューを作成しました。そのセクションのテーブルがリロードされますが、残りのセクションは表示されません。セクションがテーブルビューでタップされている行の表示または非表示
私はこれを行う方法がわかりません。 - (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section
のコードは
- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section {
if (!selected) {
headerView = [[[HeaderView alloc] initWithFrame:HeaderFrame] autorelease];
headerView.backgroundColor = [UIColor greenColor];
headerView.label.text = @"title";
headerView.button.tag = section;
headerView.tag = section;
[headerView.button addTarget:self action:@selector(buttonTapped:) forControlEvents:UIControlEventTouchUpInside];
return headerView;
}
else if (selectedIndex == section && selected){
[headerView.button setImage:[UIImage imageNamed:@"Croped-Rotated.png"] forState:UIControlStateNormal];
return headerView;
}
else
return headerView;
}
です。何か助けていただければ幸いです。
あなたがしたいことを正確に説明できますか? – Rupesh
John Abruzzi:えええええええええええええええええええええええええええええええええ投稿ありがとうございますhttp://cocoawithlove.com/2009/04/easy-custom-uitableview-drawing.html –
https://developer.apple.com/library /ios/#samplecode/TableViewUpdates/Introduction/Intro.html#//apple_ref/doc/uid/DTS40010139 - これが役に立ちます。 –