Customize UISlider color in iPhone app

I am using a slider in my application. It has a black color by default, I want to change it to brown.

I followed the "Change Slider Changes in the SDK Help"

I used the code

NSString *path = [[NSBundle mainBundle] pathForResource:@"sliderBrown"
                                                 ofType:@"png"];
UIImage *minimumTrackImg = [[UIImage alloc] initWithContentsOfFile:path];

[voiceLevelSlider setMinimumTrackImage:minimumTrackImg
                              forState:UIControlStateSelected];

but in this case my slider just disappeared.

Please enlighten me about this.

+3
source share
1 answer

Check out the UICatalog example . You can find a lot of information about creating various controls, including custom controls.

+9
source

Source: https://habr.com/ru/post/1722654/


All Articles