Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iOS unable to see last few rows of custom table cell when scrolling to the bottom.

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.

like image 860
user1118019 Avatar asked Oct 08 '22 19:10

user1118019


1 Answers

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.

like image 50
Ahsan Avatar answered Oct 12 '22 11:10

Ahsan