i want that slider which helps to unlock the iPhone in my app, but i m getting that standard slider.Please tell me is there any way to change that standard slider or there
The short answer is you have to make your own.
The long answer is that it is possible to customize a UISlider to make it look exactly like the lock slider (this will be cause for rejection, so if you are submitting make it look moderately different even then Apple can be picky about it and may still reject).
setup a UISlider with 2 background images, one for when the slider is in the minimum position, and one for when the slider is in the maximum position, and the image for the thumb.
Here is a sample setup
UIImage *minImage = [UIImage imageNamed:@"sliderback_min.png"];
UIImage *maxImage = [UIImage imageNamed:@"sliderback_max.png"];
UIImage *tumbImage= [UIImage imageNamed:@"slider_thumb.png"];
minImage=[minImage stretchableImageWithLeftCapWidth:25.0 topCapHeight:0.0];
maxImage=[maxImage stretchableImageWithLeftCapWidth:25.0 topCapHeight:0.0];
[lockScreenSlider setMinimumTrackImage:minImage forState:UIControlStateNormal];
[lockScreenSlider setMaximumTrackImage:maxImage forState:UIControlStateNormal];
[lockScreenSlider setThumbImage:tumbImage forState:UIControlStateNormal];
lockScreenSlider.minimumValue = 0.0;
lockScreenSlider.maximumValue = 100.0;
lockScreenSlider.continuous = YES;
lockScreenSlider.value = 10.0;
Next use the sliderTouchEnd delegate method to animate the slider falling back to minimum animation when the touch has ended but not fully unlocked. Something like this:
- (IBAction) sliderTouchEnd:(id)sender {
[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDuration:0.3];
lockScreenSlider.value = 10.0;
[UIView commitAnimations];
}
You have to make it yourself, but that will get you a very close proximity of the lock screen slider.
You have to make your own one using NSView and finger tracking. There is no Apple provided class for that in the SDK.
Also this might be of help:
http://www.iphonedevsdk.com/forum/iphone-sdk-development/11470-there-way-i-can-use-slide-unlock-slider.html
If you mean the "slide to unlock" slider, no, there is no way to change it.
Check out this tut:
http://duivesteyn.net/2010/04/15/iphoneos-sdk-custom-uislider-graphics/