0

When my UITableView using auto layout, how to scroll to bottom? The ContentOffsite is

   po self.tableView.contentOffset
   (x = 0, y = 0)
   (x = 0, y = 0)

The ContentSize is

   po self.tableView.contentSize
   (width = 414, height = 757)
   (width = 414, height = 757)

In fact, the ContentOffset is

   po self.tableView.contentOffset
   (x = 0, y = 1767.6666666666667)
   (x = 0, y = 1767.6666666666667)

The ContentSize is

   po self.tableView.contentSize
   (width = 414, height = 2291.3333358764648)
   (width = 414, height = 2291.3333358764648)
Guicai Li
  • 31
  • 2
  • Scrolling to the bottom of a table is not anything to do with auto layout. They are completely independent systems. What have you tried that isn't working? – Fogmeister Jul 21 '15 at 09:46
  • [self.tableView reloadData]; // TODO:Scroll to bottom NSIndexPath *indexPath = [NSIndexPath indexPathForRow:self.resultsArray.count inSection:0]; [self.tableView scrollToRowAtIndexPath:indexPath atScrollPosition:UITableViewScrollPositionBottom animated:YES]; – Guicai Li Jul 21 '15 at 09:49
  • 1
    The cell at row `self.resultsArray.count` shouldn't exist if you have `self.resultsArray.count` total cells. Try `tableView.numberOfRowsInSection(0) - 1`. – Mick MacCallum Jul 21 '15 at 09:51
  • @Fogmeister it couldn't scroll right place – Guicai Li Jul 21 '15 at 09:53

0 Answers0