views:

895

answers:

2

When configuring a Settings.bundle as part of an iPhone application bundle, it's trivial to add minimum and maximum value images to sliders (PSSliderSpecifier), but not simple maximum and minimum text labels.

http://developer.apple.com/iPhone/library/documentation/PreferenceSettings/Conceptual/SettingsApplicationSchemaReference/Articles/PSSliderSpecifier.html

iPhone gurus: Is anyone aware of a simple means to apply text labels to these sliders for use within the Settings application (therefore, no slider subclassing shenanigans; it all has to be done via a plist)? I suppose I could just use an image of the label but...ew.

Bonus points if there's a way to show the current value of a slider in some sort of number format.

A: 

I needed to do the same thing by exposing some timing variables from my code to the settings bundle so that non-developers could play around with them. As far as I know, there is no way to do this using a slider. I did, however find a good workaround:

Use a multi value control instead and give it a list of strings and values. For example, to implement picking a time using a multi value control, I would use combinations of titles and values like:

30 seconds = 30, 1 minute = 60, 5 minutes = 300, etc.

It turns out that this is a more elegant design than using a slider control anyway for picking a range of numeric values. For example, you can combine the above multi value control into an existing settings group (unlike sliders, where you need to label sliders by making a separate group for each slider).

Rolf Hendriks
A: 

I used a PSTitleValueSpecifier above each slider. Not the most elegant, but it woks. The multi value is a nice solution, as it solves the other issue with sliders - they do not display the value when you move them. I ended up using a text field instead, and rely on the user typing a reasonable value.

Israel Roth