UITableView backgroundColor always white on iPad

后端 未结 16 1637
生来不讨喜
生来不讨喜 2020-12-07 21:35

I\'m working on a project. I have plenty of UITableViews which are set as clear color. Their views\' background color are set to my custom color and everything

16条回答
  •  余生分开走
    2020-12-07 22:40

    Building off of Ben Flynn's answer... cell.contentView background color is not necessarily equal to the cell.background color. In which case, I found that this worked in resolving the iPad white background issue in more situations:

        - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
            ...
            cell.backgroundColor = cell.backgroundColor;
            return cell;
        }
    

    While the statement looks ridiculous and crazy... it resolves the issue.

提交回复
热议问题