Change background of a grouped UITableView

后端 未结 8 707
情歌与酒
情歌与酒 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:32

    Just want to add to Nirav's answer - it can also be done using the iOS 5 appearance proxy.

    [[UITableView appearance] setBackgroundView:nil];
    [[UITableView appearance] setBackgroundColor:[UIColor lightGreyColor]];
    

    The advantage is that it is applies globally, so you can group all your UI customisations in one place. However, it will apply to all tableViews (not just grouped style).

提交回复
热议问题