Reputation: 5114
I'm developing an app and I want to make it look like the settings page on iOS:
I already have this:
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:
Thanks
Upvotes: 0
Views: 216
Reputation: 7252
Switch your tableview style from plain
to grouped
.
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