5
votes

Currently I have a UITableview, I have enough data that cannot be shown entirely on the screen, so user will have to scroll the table view.

The issue I'm seeing is that when I scroll all the way to the bottom, the last element shown in the table view is not really the last element however, if I do a touch drag, and try to drag it down really hard, I can see the last element, but if I release the finger, the scroll bounced back to the element that is displayed at the bottom, but not the last element

How can I ensure tableview scroll size is really same height as the container?

I did override the two methods:

- (CGFloat) tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
 - (NSInteger)tableView:(UITableView*)tableView numberOfRowsInSection:(NSInteger)section

I can make:

- (CGFloat) tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath 

Really high, but still, when scroll down to the bottom, it is not the last element.

3
Do you have a toolbar at the bottom blocking the last row or is it totally off the screen?user470763
no toolbar, just a tableview all to itself...this is on ipad..there is no navigation beneath the tableviewuser1118019

3 Answers

3
votes

try reducing the height of the table view frame. that should do the trick.

as a starter, try reducing it by half and then if everything works fine try to calculate the necessary height.

1
votes

Check your table view's frame. If you have a navigation bar at the top your table view may be getting pushed down to accommodate it and your frame is too tall. Try reducing your table view's height.

0
votes

If you have this. Remove this.

 self.edgesForExtendedLayout = .None