点击后的cell为自定义颜色

话不多说  直接贴代码

cell 点击后一闪而过  不会停留在被点击的cell上  代码如下

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
    [tableView deselectRowAtIndexPath:indexPath animated:YES];
    
}

cell 点击为自定义颜色

//自定义cell被点击的颜色
    UIColor *color =  [RGB(244, 244, 244)colorWithAlphaComponent:.2f];
    cell.selectedBackgroundView = [[UIView alloc] initWithFrame:cell.frame];
    cell.selectedBackgroundView.backgroundColor = color;


当cell点击看起来没有点击效果 可以设置为

UIColor *color =  [UIColor clearColor];


猜你喜欢

转载自blog.csdn.net/lixianyue1991/article/details/78444505
今日推荐