我已经在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