Change iPhone tableview (style grouped) background color while preserving texture

后端 未结 4 1104
北荒
北荒 2020-12-25 14:32

How can we change the background color of tableview (style grouped) while still preserving texture of thin columns/lines effect that we can see when it has the default blue

4条回答
  •  死守一世寂寞
    2020-12-25 15:17

    Create the property of tableView:

    @property (nonatomic, strong) IBOutlet UITableView *tableView;
    

    Then synthesize it:

    @synthesize tableView = _tableView;
    

    In implementation create method:

    - (UITableView *) tableView {
      [_tableView setBackgroundColor:[UIColor whiteColor]];
      return _tableView;
    }
    

    Remember also to connect your tableView in xib file, and it should work.

提交回复
热议问题