点击后的cell为自定义颜色

来源:互联网 发布:淘宝客服服务流程图 编辑:程序博客网 时间:2024/04/18 19:21

话不多说  直接贴代码

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];


原创粉丝点击