TableView Cell Color
-
29-09-2019 - |
Question
我现在遇到了个问题,如何使uitableview cell 的背景色填满整个cell ,以下是我的代码。但它不能正常工作、、、
Picture shows:
How can I code that set the color fill in cell view?
My code is below, but it does not work well.
cell.contentView.backgroundColor =[UIColor groupTableViewBackgroundColor];
cell.backgroundColor=[UIColor groupTableViewBackgroundColor];
cell.backgroundView.backgroundColor =[UIColor groupTableViewBackgroundColor];
cell.textLabel.backgroundColor = [UIColor groupTableViewBackgroundColor];
cell.detailTextLabel.backgroundColor = [UIColor groupTableViewBackgroundColor];
Solution
it works!
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { [tableView setBackgroundColor:[UIColor groupTableViewBackgroundColor]]; return 1; }
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow