IOS cannot see the last few rows of a user-defined table cell when scrolling down.

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

The problem that I see is that when I look all the way to the end, the last item shown in the table view is not really the last item however, if I press touch and try to drag it very hard, I can see the last item, but if I let go of my finger, the scroll will return to the item that appears below, but not the last item

How can I ensure that the scroll size of the table is really the same as the container?

I have overridden two methods:

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

I can do:

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

Really tall, but when scrolling down, this is not the last element.

+4
source share
3 answers

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

as a starter, try reducing it by half, and then, if all goes well, try to calculate the required height.

+3
source

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

+1
source

If you have it. Remove it.

  self.edgesForExtendedLayout = .None 
0
source

Source: https://habr.com/ru/post/1412875/


All Articles