I have a UITableView whose contents are dynamically changing, like a FIFO stack. Cells are added to the bottom and removed from the top.
This works beautifully, and I can scroll to the indexPath so that the newest message always scrolls down to the bottom (Like a chat application).
Now.. I want to add a footer to that table section. Instead of using
SrollToRowAtIndexPath
I would like to be able to scroll to the tableFooterView.
Any ideas how I can do that would be appreciated.
UITableView scrolls back because it's content size is equal to it's frame (or near to it). If you want to scroll it without returning you need add more cells: table view content size will be large then it's frame.
To scroll to the top of our tableview we need to create a new IndexPath . This index path has two arguments, row and section . All we want to do is scroll to the top of the table view, therefore we pass 0 for the row argument and 0 for the section argument. UITableView has the scrollToRow method built in.
The view that displays below the table's content.
I am using this to scroll to the footer view of a tableView:
[self.tableView scrollRectToVisible:[self.tableView convertRect:self.tableView.tableFooterView.bounds fromView:self.tableView.tableFooterView] animated:YES];
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With