San007
San007

Reputation: 762

Custom image slider iOS

I need to design the slider like this -

enter image description here

Anyone suggest how can i set minimum and maximum track image so i can get this ?

Upvotes: 1

Views: 483

Answers (2)

Atif Imran
Atif Imran

Reputation: 2049

You could simply have an UIImageView containing your image at the background. Change the slider background to clear color and place it on the image. Your slider should have a background like your image. Next have another view on top of your background in white and use the method:

beginTrackingEvents to find the slider position. As the slider moves reduce the view width and you will have a slider background expand as you drag.

Upvotes: 0

Shamas S
Shamas S

Reputation: 7549

One idea that jumps to mind is to have 2 images.

The image on top will be a white image with it's inside cut like the shape that you have shown, and the cut part should be transparent.

Then put another image under the top image. Now you can change the frame of the colored 2nd image, that is underneath, and it would look like the slider/filler is moving rightwards/leftwards.

Upvotes: 1

Related Questions