id | title | brief | article | sdk | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
C3E20584-4062-0062-8377-CB87BAB3E6E5 |
Specify Slider Appearance |
This recipe shows how to specify the appearance of a slider, either with a custom image or colors. |
|
|
A slider control can be customized by changing the image used for the drag-able portion, or by changing the colors of the control, like this:
See the Specify Slider Value recipe for instructions on creating slider controls. To change the appearance of a slider:
- To set the slider’s “thumb” to an image:
sliderImage.SetThumbImage(UIImage.FromFile("29_icon.png"), UIControlState.Normal);
- Or to set the colors of each different element of a slider:
sliderColor.ThumbTintColor = UIColor.Red;
sliderColor.MinimumTrackTintColor = UIColor.Orange;
sliderColor.MaximumTrackTintColor = UIColor.Yellow;