开发者

how to adjust the Slider (from 0 to 70)

I need to know how to make my slider scroll from 0 until 7开发者_开发问答0 and showing the current value like in all iOS applications which use the UISlider.


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.


You sHould do these two thing

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

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

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜