I want to make UISlider
with minimumTrackTintColor
and minimumTrackTintColor
with track borderColor
I've already set a trackTintColor
for both minimum
and maximum
state but instead I want to add border for UISlider
track
- My
UISlider
looks Like this:
- I need to track border like this:
- Code
class SliderWithHeart: UISlider
{
override func awakeFromNib()
{
super.awakeFromNib()
let imageTint = UIImage(named: "SliderHeart")
self.minimumTrackTintColor = colorWithHex(hex: COLORCODE.APP_BUTTON_COLOR)
self.maximumTrackTintColor = colorWithHex(hex: COLORCODE.APP_ORANGE_COLOR)
self.setThumbImage(imageTint, for: .normal)
}
override func layoutSubviews()
{
super.layoutSubviews()
super.layer.cornerRadius = self.frame.height/2
}
override func trackRect(forBounds bounds: CGRect) -> CGRect
{
var newBounds = super.trackRect(forBounds: bounds)
newBounds.size.height = 10
return newBounds
}
}
How do I set the border color of the slider track, not the entire slider?