思路
- selectedBackgroundView的frame无法修改,但可以替换
- 在替换的view上加上view,并设置这个view的frame
代码
UIView* selectBackview = [[UIView alloc] init];
selectBackview.backgroundColor = [UIColor clearColor];
UIView* backview = [[UIView alloc] initWithFrame:cell.mainView.frame];
backview.backgroundColor = RGBAlphaColor(183,207,232,0.4);
[selectBackview addSubview:backview];
cell.selectedBackgroundView = selectBackview;