Altering the background color of cell.accessoryView and cell.editingAccessoryView

前端 未结 5 804
被撕碎了的回忆
被撕碎了的回忆 2020-12-05 13:45

Whenever I add an accessoryView to my UITableViewCell, it doesn\'t carry the background color across? I\'m setting a UISwitch as my accessoryView, and the color I have set i

5条回答
  •  臣服心动
    2020-12-05 14:00

     UIView *myView = [[UIView alloc] initWithFrame:cell.frame];
     myView.backgroundColor = [UIColor colorWithRed:214.00/255.00 green:233.00/255.00 blue:247.00/255.00 alpha:1.0];
     cell.backgroundView = myView;
     [myView release];
    

提交回复
热议问题