1
votes

I am trying to change the grey gradient background on an embedded UITableView to the color I have set on the parent view in the Storyboard.

I have been looking around, and found the following threads:

I have an IBOutlet in the parent controller connecting the two views.

My implementation looks as follows:

- (void)viewDidLoad {
    [super viewDidLoad];
    [activeShipmentsTable setBackgroundView:nil];
    [activeShipmentsTable setBackgroundView:[[[UIView alloc] init] autorelease]];
    [activeShipmentsTable setBackgroundColor:UIColor.clearColor];
}

What am I doing wrong?

Thanks.

1

1 Answers

3
votes

Try setting et the background color on the table's background view, not the table itself.

UIView *view = [[[UIView alloc] init] autorelease];
view.backgroundColor = [UIColor redColor];
self.tableView.backgroundView = view;