Pergunta

I am using custom "UISlider" to show progress bar of MPMoviePlayer. Its working fine in simulator but when i run the same on device it does not apply the image which i provide instead it shows the default behaviour I am using the following code:

UISlider *slider;
[slider setMinimumTrackImage:[UIImage imageNamed:@"progress_bar_active.png"] forState:UIControlStateHighlighted];
[slider setMaximumTrackImage:[UIImage imageNamed:@"progress_bar_background_upper.png"] forState:UIControlStateNormal];
[slider setThumbImage:[UIImage imageNamed:@"thumb.png"] forState:UIControlStateNormal];

It is just really strange.My device is iPad 2(7.0.6),iPad3(7.0.4) and Xcode Version is 5.1.1.

Thanks in Advance.

Foi útil?

Solução

Try add state UIControlStateNormal to setMinimumTrackImage and setMaximumTrackImage

[slider setMaximumTrackImage:[UIImage imageNamed:@"progress_bar_background_upper.png"] forState:UIControlStateNormal];
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top