设置cell默认和被选中时的背景色

//设置cell被选中的背景色

UIView *view = [[[UIView alloc] init] autorelease];

view.backgroundColor = [UIColor blueColor];

cell.selectedBackgroundView = view;

//设置cell默认的背景色

UIView *view = [[[UIView alloc] init] autorelease];

view.backgroundColor = [UIColor blackColor];

cell.backgroundView = view;

//清除文本标签的背景色

cell.textLabel.backgroundColor = [UIColor clearColor];

cell.detailTextLabel.backgroundColor = [UIColor clearColor];

//TableView的分隔线

tableView.separatorColor= [UIColor clearColor];

原文地址:https://www.cnblogs.com/wangshengl9263/p/3067362.html