I tried this:
- (UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section
{
CGRect footerFrame = CGRectMake(0.0, self.tableView.bounds.size.height - kCustomRowHeight, self.tableView.bounds.size.width, kCustomRowHeight);
UIView *footerView = [[UIView alloc] initWithFrame:footerFrame];
footerView.backgroundColor = self.navigationController.navigationBar.backgroundColor;
return footerView;
}
But that makes the footer view invisible.
But this works:
- (UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section
{
CGRect footerFrame = CGRectMake(0.0, self.tableView.bounds.size.height - kCustomRowHeight, self.tableView.bounds.size.width, kCustomRowHeight);
UIView *footerView = [[UIView alloc] initWithFrame:footerFrame];
footerView.backgroundColor = [UIColor redColor];
return footerView;
}
So how can I make the footer have the same background color as the navigation bar?
It’s a real pain why you try to read navigationController properties, and I do not understand why the
footerViewis invisible. Nevertheless, for your current problem… why dont you try replicating the color by setting your own RGB withalphavalues ?