Pathetic Learner
Pathetic Learner

Reputation: 729

Setting slider to max value

I am creating an application of light in which i am displaying image of light. On light i am changing the brightness of light. If i set my slider minimum and maximum value as

slider.minimumValue = -100;
slider.maximumValue = 100;

then slider shows marker at 0th position which displays as in center.But now my slider initial and maximum value has been changed as

slider.minimumValue = 0;
slider.maximumValue = 100;

I want my slider marker should be initially at 100th position of slider i.e. on the top position of slider.

Please help me to solve this problem.

Upvotes: 4

Views: 3797

Answers (5)

Satya
Satya

Reputation: 93

You can set the slider value


[slider setValue:100.0f];

Upvotes: 3

Hemant Dixit
Hemant Dixit

Reputation: 1145

Try setting value of slider:

initialization slider:

slider.value = 5.0;

minimum value:

slider.minimumValue = 0.0;

maximum value:

slider.maximumValue = 100.0;

Upvotes: 0

Meet
Meet

Reputation: 4934

Try setting the value of slider to max

[slider setValue:100.0f];

Upvotes: 2

X Slash
X Slash

Reputation: 4131

try this

[slider setValue:100.0f animated:NO];

Upvotes: 5

Ankit Srivastava
Ankit Srivastava

Reputation: 12405

slider.value = 100.0f;

will do the trick.

Upvotes: 1

Related Questions