SeongHo
SeongHo

Reputation: 1040

Objective C: UISlider (Curve)

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?

Upvotes: 3

Views: 4131

Answers (4)

Josh Gafni
Josh Gafni

Reputation: 2881

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

Upvotes: 0

Milad Rezazadeh
Milad Rezazadeh

Reputation: 1483

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.

Upvotes: 2

vrmaks
vrmaks

Reputation: 516

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

  1. MHRotaryKnob

    Cocoacontrols

    Github

  2. DCKnob

    Cocoacontrols

    Github

Upvotes: 2

Nick Weaver
Nick Weaver

Reputation: 47231

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?.

Upvotes: 0

Related Questions