0
我的滑塊電流爲50.如果向右滾動。我想得到-0到50.如果向右滾動,我想得到0到50.我不需要1到100.無法使UISlider在左邊:-0至-50之間,右邊:0至50
幫助。
- (IBAction)sliderValueChanged:(UISlider *)sender {
if ([myLabel.text length] > 50){
// Make - 0 to -50
myLabel.text = [NSString stringWithFormat:@"%d", -(int)sender.value];
}else if ([myLabel.text length] < 50){
// Make 0 to 50
myLabel.text = [NSString stringWithFormat:@"%d", (int)sender.value];
}else{
myLabel.text = [NSString stringWithFormat:@"%d", (int)sender.value];
}
}