Can anyone enlighten me on how to make the uitableview footer have a clear background?
I have added a 15 height footer which is added via the following -
-(CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section{
if (section==0){
return 0;
}
else{
return 15;
}
}
that works fine - but the footer is a grey strip - the tableview has a background image - so i'd like the footer to be clear - is this possible? if so how do i style it?
There is a delegate method - (void)tableView:(UITableView *)tableView willDisplayFooterView:(UIView *)view forSection:(NSInteger)section NS_AVAILABLE_IOS(6_0);
You can use this method like this
- (void)tableView:(UITableView *)tableView willDisplayFooterView:(UIView *)view forSection:(NSInteger)section {
//Set the background color of the View
view.tintColor = [UIColor blueColor];
//Set the TextLabel Color
UITableViewHeaderFooterView *header = (UITableViewHeaderFooterView *)view;
[header.textLabel setTextColor:[UIColor whiteColor]];
}
Implement the - (UIView *)tableView:(UITableView*)tableView viewForFooterInSection:(NSInteger)section delegate and return a UIView in it with clear background.
You could also try setting the [self.table setTableFooterView:nil]
That should solve the issue.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With