3

Is it possible to have a curve UISlider or is it just Horizontal and Vertical?

I've tried replacing the slider track with a curve image (though i already know hat it will not work because it is just a background), not working.

Is there a way that i could do that?

SeongHo
  • 1,040
  • 2
  • 15
  • 39

4 Answers4

2

I wrote this sample app to show how to use a Curve UIBezierPath and move an object through it you can take a look at :

I will try to update it.

Milad Rezazadeh
  • 1,473
  • 12
  • 34
2

Take a look at custom controls (both of them are under MIT license):

  1. MHRotaryKnob

    Cocoacontrols

    Github

  2. DCKnob

    Cocoacontrols

    Github

vrmaks
  • 516
  • 4
  • 6
0

You can also check out BezierSlider which allows you to customize the path and the selector.

Josh Gafni
  • 2,831
  • 2
  • 19
  • 32
0

No you can't do this with the UISlider, only in a straight line. You can rotate the whole slider to a degree you like with the transform property and use a function like CGAffineTransformMakeRotation. An example: How to use CGAffineTransformMakeRotation?.

Community
  • 1
  • 1
Nick Weaver
  • 47,228
  • 12
  • 98
  • 108