自定义cell
这里设置bgView或者contentview的颜色,等于cell高亮状态的颜色
- (void)setHighlighted:(BOOL)highlighted animated:(BOOL)animated
{
[super setHighlighted:highlighted animated:animated];
self.selectedBackgroundView = [[HYView alloc] initWithColor:[UIColor redColor]];
}
UITableViewDelegate 的代理方法
设置cell的反选中效果
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
[tableView deselectRowAtIndexPath:indexPath animated:YES];
}
网友评论