设置cell背景色和选中色

1 // 设置cell的背景色
2 UIView *bg = [[[UIView alloc] init] autorelease];
3 bg.backgroundColor = [UIColor colorWithRed:0.95 green:0.95 blue:0.95 alpha:1];
4 cell.backgroundView = bg;
1 // 设置cell选中的背景
2 UIView *selectdBg = [[[UIView alloc] init] autorelease];
3 selectdBg.backgroundColor = [UIColor colorWithRed:0.85 green:0.85 blue:0.85 alpha:1];
4 cell.selectedBackgroundView = selectdBg;
 
原文地址:https://www.cnblogs.com/wangshengl9263/p/3234577.html