UISlider相關整理
阿新 • • 發佈:2019-01-30
self.slider = [[ASValueTrackingSlider alloc] initWithFrame:CGRectMake(10 , 50, kScreenW - 40, 30)];
[self.slider setMaxFractionDigitsDisplayed:0];
self.slider.minimumValue = 10;// 設定最小值
self.slider.maximumValue = 99;// 設定最大值
self.slider.font = [UIFont fontWithName:@"Futura-CondensedExtraBold" size:26];
self.slider.popUpViewAnimatedColors = @[kTabBarColor, [UIColor orangeColor], [UIColor redColor]];
[self.slider addTarget:self action:@selector(sliderValueChanged:) forControlEvents:UIControlEventValueChanged];
[scrollView addSubview: self.slider];
- (void)sliderValueChanged:(id )sender {
self.slider = (ASValueTrackingSlider *)sender;
zheStr = [NSString stringWithFormat:@"%d",(int)self.slider.value];
// self.valueLabel.text = [NSString stringWithFormat:@"%.1f", slider.value];
}