Question

As a picture says more than a thousand words: alt text http://img.skitch.com/20091008-k16k7we3t43gj3h7htgtjpunpx.jpg

Any help on how to add descriptive labels to a settings pane would be highly appreciated! I should point out that I want to do this to be in the iPhone-App settings that are in the Settings menu of the iPhone (outside the App).

Example label:

  • iPhone -> Settings -> Safari -> Fraud Warning
  • The label beneath: "Warn when visiting fraudulent websites."
Was it helpful?

Solution

Unfortunately, Apple has not given iPhone developers the capability to add the kind of label you're looking for in Settings.app. As a near approximation, I've used PSGroupSpecifier under another setting element (such as PSToggleSwitchSpecifier). It's not as elegant as a true label, but it worked well enough in my situation (I only had one setting, so it didn't conflict with any other group headings).

alt text http://pseudorandomengineer.com/images/6.png

OTHER TIPS

For reference: Since iOS4.0 and above a FooterText key was added to PSGroupSpecifier that does exactly what you are looking for.

http://developer.apple.com/library/ios/documentation/PreferenceSettings/Conceptual/SettingsApplicationSchemaReference/SettingsApplicationSchemaReference.pdf (pg 11)

Try using a PSTitleValueSpecifier in your settings bundle's plist. I'm not sure how that formats itself—most likely bold, like the group headers—but it might be what you're looking for.

If you want to simulate a label that is center-justified, add an empty title PSGroupSpecifier and put your label text in the FooterText Key.

Check out the tableView:titleForFooterInSection: method of UITableViewDataSource. You can return a string to be displayed below a table view section. If you're already using a UITableViewController subclass, just implement that method and you're good to go.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top