UITableView Archives

How to style a table view header / footer

The UITableView implements a header and a footer when you’re using the tableView:titleForHeaderInSection method (tableView:titleForFooterInSection respectively). However when the header (or the footer) is displayed you can’t change the font or colour of your text. You can however implement the following methods in your table view delegate and create a custom UILabel object for the […]

How to add a background image to a table view

The easiest way to do this is by adding a UIImage to your table. Rather than instantiating a new table object you can simply add the following line into the first Table View Data Source method you have – such as this one: – (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { tableView.backgroundView = [[UIImageView alloc]initWithImage:[UIImage imageNamed:@”background.jpg”]]; // Return the […]