Search code examples
uitableviewios5xcode4.2

Setting the style of UITableView section headers


I'm working with iOS 5 and have dynamically generated cells in a table (2 sections of 3 rows each). Each section has a header that is also dynamically generated using the titleForHeaderInSection call.

I also have an image set as the background for the table that makes the default color of the section headers hard to read. I haven't found a way to change the color of the section headers (or shadow color, font, text size, etc for that matter) either through the Storyboard interface or programmatically! Please help!


Solution

  • You can modify the font size/color/etc by creating your own view for the section header using the method tableView:viewForHeaderInSection:

    There's an example of this technique here