Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

UITableView not scrolling to bottom

Hi I'm going to link you a video showcasing my problem as it's somewhat hard to convey with words. UITableView not scrolling to bottom In the video I'm hitting a button which adds items to the list. Note that I am not stopping at Item 16, and that I am still adding more items to the list that don't get displayed. Eventually, upon added new items, the list will automatically scroll up via

[_items addObject:[NSString stringWithFormat:@"Trawl %d", count]];

[self.tbl reloadData];

[self.tbl scrollToRowAtIndexPath:[NSIndexPath indexPathForItem:self.items.count - 1 inSection:0] atScrollPosition:UITableViewScrollPositionBottom animated:YES];

The main issue is towards the end of the video, where I scroll towards the last few items, but I cannot select them. Apparently the issue has to deal with the height of the UITableView. I've tried changing this in the storyboard editor but it didn't do anything. Any ideas? Thanks in advance!

like image 385
user2402616 Avatar asked Jan 27 '14 00:01

user2402616


1 Answers

Ok from what I can see and from the comments, I think it is likely that the height of your UITableView is larger than the device screen size, which means it will not scroll down because the items haven't reached the bottom of the UITableView's UIScrollView.

Go to IB and set constraints so the UITableView is equal to the view controllers width and height.

like image 72
Nic Robertson Avatar answered Oct 15 '22 14:10

Nic Robertson