Andrew
Andrew

Reputation: 3999

How can I group editable information like in Apple's "Settings" application?

I'm looking to make a view similar to Apple's "Settings" application. Example: http://www.amitbhawani.com/apple/Images/I/iphone-MMS-Settings.jpg

How can I set up my application to look/work like that?

Upvotes: 0

Views: 154

Answers (3)

Moshe
Moshe

Reputation: 58087

Like others have said, you want to make use a UITableView with grouped styles. In your

- (void) viewDidLoad

method, add the following line of code:

[self.tableView initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, self.view.framw.size.height) style: UITableViewStyleGrouped];

It should give you the appropriate style.

I would say that you should add switches and text fields as accessoryViews, not contentViews, though.

See the Documentation for more on customizing UITableView.

Also, see my question here, the answers there may be helpful: Custom UITableViewCell for Settings-like application?

Upvotes: 1

Adam Milligan
Adam Milligan

Reputation: 2826

You'll need to use a UITableView with the style set to UITableViewStyleGrouped for the appearance. For editable fields you should be able to add UITextField views to the contentView property of the tableView cells.

Upvotes: 1

Lily Ballard
Lily Ballard

Reputation: 185681

That's just a grouped tableview, with section headers.

Upvotes: 1

Related Questions