Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to make custom curvy UISlider?

I want to create custom curvy UISlider as like below screen which is fit to screen.

enter image description here

I checked MTCircularSlider library and also apply of tranform animaton to UISlider control but none of them working. My mind got stuck after performing many tries.

Thank you

like image 676
Jaydeep Vora Avatar asked Jan 25 '18 06:01

Jaydeep Vora


1 Answers

Using MTCircularSlider library

fileprivate var controlRadius: CGFloat {
     return min(bounds.width, bounds.height) / 2.0 - controlThickness
 }

See above this library uses min value from width and height.

So, You need to maintain your view width, because it's depend on minimum value of View. You can mange your view by leading and trailing according below screenshotenter image description here

or either you can use by proportionalWidth constrain to 0.80 of your superview

And also set the trackAngle as below

enter image description here

like image 177
Hitesh Avatar answered Oct 13 '22 00:10

Hitesh