Does anyone have a quick way to make a UISlider that looks like the ones in the iPod app (think scrubber/volume control). Basically I need something that looks exactly like an MPVolumeView, but doesn't control sound. Failing that, does anyone have the assets to make one (the knob/track).
A UISlider object is used for selecting a single value from a continuous range of values. The value is decreased or increased as the user moves the “thumb” of the slider along its track.
Yeah, I knew how to create the custom slider, I just wanted to know if anyone had the images already. I guess not, so I extracted my own.
For future reference, if anyone else needs to do this:
Gallery of assets below, http://img200.imageshack.us/gal.php?g=whiteslide.png
Download those images, and use this code to set it all up:
scrubberSlider.backgroundColor = [UIColor clearColor];
UIImage *stetchLeftTrack = [[UIImage imageNamed:@"blueTrack.png"]
stretchableImageWithLeftCapWidth:9.0 topCapHeight:0.0];
UIImage *stetchRightTrack = [[UIImage imageNamed:@"whiteTrack.png"]
stretchableImageWithLeftCapWidth:9.0 topCapHeight:0.0];
[scrubberSlider setThumbImage: [UIImage imageNamed:@"whiteSlide.png"] forState:UIControlStateNormal];
[scrubberSlider setMinimumTrackImage:stetchLeftTrack forState:UIControlStateNormal];
[scrubberSlider setMaximumTrackImage:stetchRightTrack forState:UIControlStateNormal];
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With