I’ve an UISlider on my app and I need sometimes to update not only its value but also its minimumValue. The values are changed but if I call the setValue method or assign a new value for my slider, it has the new value but the slider does not repaint itself to the position it should be for this new value. How can I repaint it?
This is a piece of code where I change the minimumValue.
if([array count] < 50)
[sliderTamanyo setMinimumValue:2];
else if([array count] < 200)
[sliderTamanyo setMinimumValue:3];
else
[sliderTamanyo setMinimumValue:4];
if(sliderTamanyo.value < sliderTamanyo.minimumValue)
self.sliderTamanyo.value = self.sliderTamanyo.minimumValue;
[self.sliderTamanyo setNeedsDisplay];
I’ve solved that by removing and adding again the slider to the toolbar. I’ve used this code:
I’ve recovered my slider using an
idinstead anUISliderbecause that slider is inside aUIBarButtonItem