I've customized my UISlider but my thumb image looks strange, I mean it's position not aligned by center:
But should be like this:
And here is code:
UIImage *leftTrack = [[UIImage imageNamed:@"blueTrack.png"] stretchableImageWithLeftCapWidth:3 topCapHeight:0];
UIImage *rightTrack = [[UIImage imageNamed:@"whiteTrack.png"] stretchableImageWithLeftCapWidth:3 topCapHeight:0];
[slider setThumbImage:[UIImage imageNamed:@"thumbButton.png"] forState:UIControlStateNormal];
[slider setMinimumTrackImage:leftTrack forState:UIControlStateNormal];
[slider setMaximumTrackImage:rightTrack forState:UIControlStateNormal];
Where could be the problem?
EDIT: I found solution of this problem. Thumb image background was transparent, and I've not seen that thumb image was not aligned by center:
Comments
Post a Comment