UISlider *slider = [[UISlider alloc] initWithFrame:CGRectMake(0, 30, 300, 50)];slider.minimumTrackTintColor = [UIColor redColor];slider.maximumTrackTintColor = [UIColor greenColor];UIImage *thumb = [UIImage imageNamed:@"round_30"];[slider setThumbImage:thumb forState:UIControlStateNormal];[slider setThumbImage:thumb forState:UIControlStateHighlighted];slider.maximumValue = 100;slider.minimumValue = 0;slider.value = slider.maximumValue / 2;[slider addTarget:self action:@selector(change:) forControlEvents:UIControlEventValueChanged];
- (void)change:(UISlider *)slider
{float value = slider.value;NSLog(@"value = %f", value);
}