我已經在tableview中使用- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section
對部分進行了自定義視圖,但是在iam重新加載tableview的部分點擊了按鈕時。它爲該部分重新加載表格,但其餘部分未顯示。顯示或隱藏行在表視圖中點擊部分時
我不知道該怎麼做。代碼- (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 2012-03-13 06:34:32
約翰阿布魯齊:嘿魚febonchi大聲笑哪裏..這可能會幫助您先生http://cocoawithlove.com/2009/04/easy-custom-uitableview-drawing.html – 2012-03-13 07:06:56
https://developer.apple.com/library /ios/#samplecode/TableViewUpdates/Introduction/Intro.html#//apple_ref/doc/uid/DTS40010139 - 這可能會對您有所幫助。 – 2012-03-13 08:45:10