UISlider *slider = [[UISlider alloc] initWithFrame:CGRectMake(50, 50, 100, 40)];
[self.view addSubview:slider];
The problem is that, I cannot view UISlider at all but I can still drag it. I have to guess the position and drag.
The compile environment is based on ios 6 sdk (mandatory because my app doesn't use flat yet) Does anybody know how to fix this? Thank you very much.
I've also experienced this with an iOS 6.1 application running on iOS 8.3.
It appears that Apple have cleaned up the image resources which are for the old iOS appearance. I'm not sure if this was a mistake or intentional.
I found a solution to the issue using the methods provided to customise the appearance of the control which are detailed in the UISlider class reference.
Here's my code:
[self.myControl setThumbImage:[UIImage imageNamed:@"thumb.png"] forState:UIControlStateNormal];
[self.myControl setMaximumTrackImage:[UIImage imageNamed:@"background.png"] forState:UIControlStateNormal];
[self.myControl setMinimumTrackImage:[UIImage imageNamed:@"highlight.png"] forState:UIControlStateNormal];
I was able to re-create the standard appearance relatively easily.
I hope this helps.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With