【发布时间】:2014-06-04 21:31:13
【问题描述】:
在我的应用程序中,我使用的是 UITableView。我想用图像突出显示单元格。 我的代码是:
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
UITableViewCell *cell = [slideMenuTableView cellForRowAtIndexPath:indexPath];
UIImageView *image = [[UIImageView alloc]initWithImage:[UIImage imageNamed:@"selected_tab_bg.png"]];
cell.selectedBackgroundView = image;
}
它突出显示单元格,但是当我选择另一个单元格时,前一个单元格也被选中,如下所示。当我选择另一个单元格时,我想清除上一个单元格
在屏幕截图中,列表视图和搜索被突出显示。
【问题讨论】:
标签: ios uitableview