Objective-c – Adding text labels to sliders in iPhone Settings application


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.


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.

Best Solution

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).