Multi Column header for UITableView with multiple columns

I created a UITableView with multiple columns to display a soccer league table. Now I really need a heading for each column that fits perfectly at the top of the table. How can I do it?

+4
source share
3 answers

You can create a custom UIView and set it as the title of the first section of your UITableView. Return it to your UITableViewDelegate tableView: viewForHeaderInSection: method. You just need to design it so that it aligns with the "columns" inside your user cells.

+7
source

Instead of setting it as the title for your first UITableView section, in your situation it would be more reasonable to set it as the title for your entire table. This can be done using the tableHeaderView property of the UITableView . For instance:

 UIView *myHeaderView = ... [myTableView setTableHeaderView:myHeaderView]; 
+7
source

This is a kind of weird interface for the iPhone application, assuming you are trying to reproduce the look of an HTML table with headers, cells, etc.

If this is what you want, why not just use the UIWebView object to display your table?

-6
source

All Articles