How to remove blank spaces on Hiding rows in Table View Cell?
i was able to hide row on Table View Cell by usi开发者_高级运维ng this code
cell.hidden = YES;
the problem is it gives blank spaces (show on the picture).
Is there any way on eliminating this blank spaces?
Thank you.
You need to set the correct height for the cell in the UITableViewDelegate.
- (CGFloat) tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
if (indexPath.row == someIndex) {
return 0.0f;
}
return 65.0f;
}
Better would be to not have the cell in tabelview at all.
精彩评论