简体   繁体   中英

UISlider thumb image issue..!

我们如何将UISlider的缩略图设置为一旦达到最大值便停止,即,一旦缩略图达到最大值(最后),用户就不能移动缩略图。

Something like the following:

[slider setContinuous:YES];
[slider addTarget:self action:@selector(sliderChanged:) forControlEvents:UIControlEventValueChanged];

and then

- (void)sliderChanged:(UISlider*)sender {
    if ([slider value] >= [slider maximumValue]) {
      [slider setEnabled:NO];
    }
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM