Why Is my UISlider Thumb Image Being Shown Multiple Times and Not Disappearing As They Should?
- by Gorgando
This slider is possessed:
When I move the slider thumb left or right, it leaves the original image there (creating an extra image). This doesn't happen every time and the only consistency i've noticed is that it's inconsistent. When the table is in "Editing mode" it is more likely to create a duplicate thumb image, but it also does so in regular mode.
This is the code that I use to create the slider:
CGRect frame = CGRectMake(20, 42.0, 280.0, 22);
self.slider = [[UISlider alloc] initWithFrame:frame];
[self.slider addTarget:self action:@selector(sliderAction:) forControlEvents:UIControlEventValueChanged];
self.slider.continuous = YES;
self.slider.minimumValue = 0.0;
self.slider.maximumValue = 5.0;
self.slider.value = 0.0;
[sliderCell addSubview:self.slider];
Appreciate any thoughts you might have!