daydreamer
daydreamer

Reputation: 92179

UITableView: last cell is not completely visible

In my custom UITableViewCell I set the height of row as

- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
    return 70;
}

As a result (I believe), when data is rendered, the last cell is not rendered correctly.

enter image description here

This happens on all views where I set the heightForRowAtIndexPath. How do I fix it, so that I can see last cell as well?

Upvotes: 3

Views: 2364

Answers (3)

xhinliang
xhinliang

Reputation: 164

Perhaps your UITableView's height is not right, check it.

Upvotes: 0

Burhanuddin Sunelwala
Burhanuddin Sunelwala

Reputation: 5343

If you are using AutoLayout then you need to set constraints to your tableView with Respect to its superview.

Else if just set

[tableView setAutoresizingMask:UIViewAutoresizingMaskFelxibleHeight | UIViewAutoResizingMaskFlexibleWidth];

Upvotes: 0

Sanjay Mohnani
Sanjay Mohnani

Reputation: 5967

You are returning the height of the cell correctly and this issue seems to be related with table view and not with the cell, I think you need to reduce the height of the tableView.

Upvotes: 2

Related Questions