UITableViewCell点击样式

1.点击UITableViewCell时,没有点击效果,在cellForRowAtIndexPath:方法中写上

cell.selectionStyle = UITableViewCellSelectionStyleNone;

 

2.点击UITableCell时,Cell背景颜色不变,但是上面自定义的控件如:UILabel、UIImageView会变颜色

设置UILabel或UIImageView的Highlighted 然后 在cellForRowAtIndexPath:方法中写上

            UIView *view_bg = [[[UIView alloc]initWithFrame:cell.frame]autorelease];

            view_bg.backgroundColor = [UIColor clearColor];

            cell.selectedBackgroundView = view_bg;

 

3.点击cell行时,背景颜色一闪而过,在didSelectRowAtIndexPath:方法中写上

[tableView deselectRowAtIndexPath:indexPath animated:NO];

原文地址:https://www.cnblogs.com/liuyingjie/p/5095805.html