Is there any way to change the alpha of a UISlider's track image? I want to use documented API's so my a开发者_如何转开发pp can get on the app store.I am using apple's default track image and NOT my own. Is this possible?
Thanks!
You can obtain the slider's track images using the currentMaximumTrackImage
and currentMinimumTrackImage
properties. You can then adjust the alpha on these images but this is quite tedious to do with code as you'd have to set up a context, draw the image with the alpha, then obtain the new image from the context. Note that you would have to do this for the minimum and maximum track images for each applicable state of the control.
Can't you set the alpha on the whole slider, or do you just want the track to have an alpha rather than the whole control?
You will need to make your own png image and change the alpha.
精彩评论