Why Is my UISlider Thumb Image Being Shown Multiple Times and Not Disappearing As They Should?
Posted
by Gorgando
on Stack Overflow
See other posts from Stack Overflow
or by Gorgando
Published on 2010-05-28T20:39:50Z
Indexed on
2010/05/28
20:42 UTC
Read the original article
Hit count: 275
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!
© Stack Overflow or respective owner