我想在用户单击单元格后立即更改uitableviewcell的自定义accessoryView。我将如何做到这一点?更改uitableviewcell中的自定义accessoryView?
为了记录在案,我使用的是马特·加拉格尔”自定义表视图教程:
http://cocoawithlove.com/2009/04/easy-custom-uitableview-drawing.html
下载链接来源:http://projectswithlove.com/projects/EasyCustomTable.zip
编辑
尝试这种代码,但它只是在触摸后更改附件。还试着用相同的结果willSelectRowAtIndexPath。
- (NSIndexPath *)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
UIImage *indicatorImage = [UIImage imageNamed:@"indicatorSelected.png"];
UITableViewCell *cell = [self.tableView cellForRowAtIndexPath:indexPath];
cell.accessoryView = [[[UIImageView alloc] initWithImage:indicatorImage] autorelease];
return indexPath;
}
EDIT
问题通过使细胞的背景图像解决包含的附件。因此附件是“伪造”通过使图像的一部分
没有相当的工作。查看更新后的问题 – cannyboy 2010-05-20 16:39:55