Change background of a grouped UITableView

后端 未结 8 653
情歌与酒
情歌与酒 2020-12-31 01:16

I\'m having some trouble trying to change the background of a UITableView with groups.

_tableView.backgroundColor = [UIColor colorWithPatternImage:[UIImage i         


        
相关标签:
8条回答
  • 2020-12-31 01:51

    What I usually do with grouped UITableViews is set the background color to clear, and the set that pattern image to the parents view.

    self.parentViewController.view.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"tableBG.png"]];
    self.tableView.backgroundColor = [UIColor clearColor];
    
    0 讨论(0)
  • 2020-12-31 01:53

    The selected answer works but it clears the background of both tableHeaderView and table section header view. If you just want table header to be of a certain color say white and section header still to be default grey than do the following -

    tableView.tableHeaderView.inputView.backgroundColor = [UIColor whiteColor];
    
    0 讨论(0)
提交回复
热议问题