I need to add an UISlider control in my iphone application. That should look like the “Slide to unlock” slider which is displayed in any iphone or ipod touch. I am unable to figure out how to do this.
In slide to unlock slider, if we leave the thumbImage in the middle of the slider it comes back to the left side automatically. How do we get this kind of functionality working in our project.
You have to implement this yourself using the UISlider methods. First you have to create a slider of the proper size in code using initWithFrame:. Then just chop up the images that you’d like and set them using:
Then, in your slider’s action method, check to see if the slider is at the maximum value. If not, use
most likely using animated=YES. I think you have to turn off continuous updates or you will get actions at every step, causing you to always animate backwards. You may have to tweak some of this but it should work well. You aren’t going to get the text effect that Apple does but using static images it will get pretty close.