eestein
eestein

Reputation: 5114

How can I mimic the iOS settings page layout?

I'm developing an app and I want to make it look like the settings page on iOS:

enter image description here

I already have this:

enter image description here

But as you can see I couldn't replicate the gray background and the section titles.

How can I do that? Create that gray background and add a space like in this image:

enter image description here

Thanks

Upvotes: 0

Views: 216

Answers (1)

Beau Nouvelle
Beau Nouvelle

Reputation: 7252

Switch your tableview style from plain to grouped.

enter image description here

Then just use the below code to set your section titles just as you usually would, they will appear the same as the settings app:

func tableView(tableView: UITableView, titleForHeaderInSection section: Int) -> String? {
    return "some section title"
}

Upvotes: 1

Related Questions