开发者

How to remove blank spaces on Hiding rows in Table View Cell?

开发者 https://www.devze.com 2023-04-10 05:07 出处:网络
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).

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).

How to remove blank spaces on Hiding rows in Table View Cell?

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消