tableview修改selectedBackgroundView的frame

来源:互联网 发布:淘宝双11 销售额 编辑:程序博客网 时间:2024/06/05 00:15

思路

  1. selectedBackgroundView的frame无法修改,但可以替换
  2. 在替换的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;

效果图

这里写图片描述

阅读全文
0 0