自定義cell
這里設(shè)置bgView或者contentview的顏色,等于cell高亮狀態(tài)的顏色
- (void)setHighlighted:(BOOL)highlighted animated:(BOOL)animated
{
[super setHighlighted:highlighted animated:animated];
self.selectedBackgroundView = [[HYView alloc] initWithColor:[UIColor redColor]];
}
UITableViewDelegate 的代理方法
設(shè)置cell的反選中效果
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
[tableView deselectRowAtIndexPath:indexPath animated:YES];
}