设置UITableViewCell的背景色:
UIView *bgView = [[UIView alloc] initWithFrame:cell.bounds];
bgView.backgroundColor = UIColor.grayColor;
cell.backgroundView = bgView;
设置UITableViewCell的选中色:
UIView *selectedView = [[UIView alloc] initWithFrame:cell.bounds];
selectedView.backgroundColor = UIColor.redColor;
cell.selectedBackgroundView = selectedView;
点击cell, 保留cell上控件的背景色:
(1)在下面的方法中添加控件的背景色
- (void)layoutSubviews;
网友评论