Malloc
Malloc

Reputation: 16276

how to adjust the Slider (from 0 to 70)

I need to know how to make my slider scroll from 0 until 70 and showing the current value like in all iOS applications which use the UISlider.

Upvotes: 0

Views: 336

Answers (2)

Nagendra Tripathi
Nagendra Tripathi

Reputation: 923

You sHould do these two thing

label1.text=[[NSString alloc] initWithFormat:@"%.0f",slider1.value];

slider1.minimumValue=0;
slider1.maximumValue=100;
slider1.continuous=YES;

Upvotes: 1

Mark Granoff
Mark Granoff

Reputation: 16938

A UISlider has minimumValue and maximumValue properties, whose default values are 0.0 and 1.0, respectively. To set the slider to 70, using these defaults, you would set the slider's value to 0.70.

To actually show that value (70) on the screen, you would need to have a separate UILabel in your UI that you update when the slider value updates.

Upvotes: 2

Related Questions