如何创建滑块并滑动值增加10,20,30 ...&以这种格式减少了-10,-20,-30 ......帮助任何其他链接获取教程或源代码。感谢先生
答案 0 :(得分:0)
UISlider* mySlider = [[UISlider alloc] init];
mySlider.minimumValue = -30.0f;
mySlider.maximumValue = 30.0f;
-(IBAction) sliderChanged:(id) sender{
UISlider *slider = (UISlider *) sender;
int progressAsInt =(int)(slider.value + 0.5f);
NSString *newText =[[NSString alloc]
initWithFormat:@"%d",progressAsInt];
self.sliderLabel.text = newText;
}