- Q: 点击UITableViewCell时,没有点击效果。
解决办法,在cellForRowAtIndexPath方法中写上
cell.selectionStyle = UITableViewCellSelectionStyleNone;
- Q: 点击UITableCell时,Cell背景颜色不变,但是上面自定义的控件如:UILabel、UIImageView会变颜色。
解决办法,设置UILabel或UIImageView的Highlighted,然后在cellForRowAtIndexPath:方法中写上
UIView *bgView = [[UIView alloc] initWithFrame:cell.frame];
bgView.backgroundColor= [UIColor clearColor];
cell.selectedBackgroundView= bgView;
- Q: 点击cell行时,背景颜色一闪而过。
解决办法,在didSelectRowAtIndexPath:方法中写上
[tableView deselectRowAtIndexPath:indexPath animated:NO];