Table Styles

On the iPhone, tables come in two formats: plain table lists and grouped tables. Plain tables, by default, display on a simple white background with transparent cells. The iOS Settings application uses the grouped style, which displays on a light gray background with each subsection appearing over a white background.

Changing styles requires nothing more than initializing the table view controller with a different style. You can do this explicitly when creating a new instance. This cannot be changed after initialization. Here’s an example:

myTableViewController = [[UITableViewController alloc]     initWithStyle:UITableViewStyleGrouped];

When using controllers from XIBs and storyboards, adjust the Table ...

Get The Core iOS Developer’s Cookbook, Fifth Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.