UISlider 设置增量
UISlider *slier = [[UISlider alloc]initWithFrame:CGRectMake(wu500.right, 0, 210, 50)]; slier.minimumValue = 500; slier.maximumValue = 4000; slier.thumbTintColor = [UIColor redColor]; [self.view addSubview:slier]; [slier addTarget:self action:@selector(sliderValueChanges:) forControlEvents:UIControlEventValueChanged];
- (void)sliderValueChanges:(UISlider *)slider{ [slider setValue:((int)((slider.value + 250) / 500) * 500) animated:YES]; NSLog(@"line(%d): %@,%f",__LINE__,@"slider value ->",slider.value);}