iPhone: how to create a transparent table header

March 1, 2009 · Posted in Tech · 6 Comments 

A couple of weeks ago I was wondering how you created a transparent header for a table view on the iPhone like the one that’s in the built in contacts app detail view. Here’s a video of the contacts app so that you can see what I’m trying to achieve:

Initially, I thought that the way to do this was to add an additional section to the table and add a custom cell to it. That kind of works, but is quite hard work. I think I’ve found a better and simpler way – by using the tableView:viewForHeaderInSection method on UITableViewDelegate.

To start with, we need to create a basic view-based Cocoa Touch app in XCode. I’ve called mine ContactStylee. I’ve zipped up the completed XCode project for you so that you can follow along.

Read more