开发者

How to create a iPhone Settings-like view

开发者 https://www.devze.com 2023-02-09 13:02 出处:网络
I want to create a view similar to the iPhone\'s Settings app. I开发者_JS百科s this view using a UITableView or what?Are the items created programmatically or is it possible to do this in Interface B

I want to create a view similar to the iPhone's Settings app.

I开发者_JS百科s this view using a UITableView or what? Are the items created programmatically or is it possible to do this in Interface Builder?


It is a UITableView with style: UITableViewStyleGrouped

It is possible to do so in Interface builder and there are a number of ways.

This article describes the most intuitive way a Google search has to offer: http://www.galloway.me.uk/tutorials/custom-uitableviewcell/

Key steps are:

  • Create UIViewController with xib (not table view controller)
  • replace it's initial view with a UITableView
  • implement UITableViewDelegate and UITableViewDatasource protocols
  • add any additional UITableViewCells to Interface Builder as extra views
  • refer to them in your view controller class as IBOutlet UITableViewCell *
  • use connections inspector to connect IBOutlets in view controller to cells in Interface Builder


Have a look at InAppSettingsKit Project which does not only to do settings in your app but it also provides the ability to have the settings externalized into the iPhone's settings app. This is probably the easiest way to get settings into your app.


What you see in the Settigs App is different sections of a UITableView with "grouped" style, using a navigation controller. Have a look at the UICatalog example, as well as the Table View Programming Guide for iOS.


Try FormKit. It will let you create Settings app like forms very easily.

How to create a iPhone Settings-like view

0

精彩评论

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

关注公众号