I need hide a UITableViewCell. I set backgroundColor to clear, but cell still visible. Please see the screenshot.
cell.backgroundColor = [UIColor clearColor];
I need hide a UITableViewCell. I set backgroundColor to clear, but cell still visible. Please see the screenshot.
cell.backgroundColor = [UIColor clearColor];
Normally, you wouldn't hide it this way. Rather, you should try not displaying it at all. In your table view controller's numberOfRowsInSection method, try something like this:
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
//... code regarding other sections goes here
if (section == 1) { // "1" is the section I want to hide
if (self.cellShouldBeVisible) {
return 0; // show no cells
} else {
return 1; // show one cell
}
}
}
(you can replace self.cellShouldBeVisible with your own code of course)
If you want to go from displaying to not displaying the cell, set self.cellShouldBeVisible to the desired BOOL value and call [self.tableView reloadData];