Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

UITableView Footer, Stop from floating over content

I would like to make my UITableView Footer stop floating over my content, as is the default activity. I want my footer to be.. well.. a footer. Always the last view to be displayed at the end of my tableview. :)

Same thing with the header too actually.

Is there any easy way to disable it from floating over top of the table view as you scroll?

Thank you everyone, I couldn't find an answer elsewhere.

like image 229
Jason Avatar asked Apr 21 '11 06:04

Jason


People also ask

How can I make the Footerview always stay at the bottom in Uitableviewcontroller?

If you need to make the footer view fixed at the bottom then you can not use a TableViewController . You will have to use UIViewController , put your tableView as a subview. Put the footer also as another subview and its done.


2 Answers

Ok, it turns out that if you set the footer view via blahblahtableView.tableFooterView = someview; , the footer will not scroll with the table.

However, if you create your footer using viewForFooterInSection, it WILL follow your view around and stick on the bottom of the screen.

Not sure why I couldn't find this answer sooner. Sorry all :)

like image 157
Jason Avatar answered Sep 17 '22 23:09

Jason


- (id)init {     self = [self initWithStyle:UITableViewStyleGrouped]; //Default is UITableViewStylePlain     return self; } 
like image 29
guogangj Avatar answered Sep 19 '22 23:09

guogangj