开发者

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

I'm looking开发者_StackOverflow 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?


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.


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


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?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜