Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to scroll a UITableView to the tableFooterView

Tags:

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.

like image 495
Kevin Avatar asked Aug 31 '09 03:08

Kevin


People also ask

Is UITableView scrollable?

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.

How do I scroll to the top of a Tableview table?

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.

What is Tablefooterview?

The view that displays below the table's content.


1 Answers

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]; 
like image 192
Ned Avatar answered Sep 26 '22 03:09

Ned