如何在 IOS 的 UI 滑块中添加不同的颜色? [英] How to add different color in a UI slider in IOS?
本文介绍了如何在 IOS 的 UI 滑块中添加不同的颜色?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在构建一个 iOS
应用程序,我在同一个栏上使用 2 个 slider
来选择 max
和 min代码> 值.我参考了下面的链接,我正在使用点反馈滑块.
I am building an iOS
application where I am using 2 sliders
on the same bar for selecting max
and min
values. I have taken reference of the below link and I am using Point feedback slider.
现在我面临的问题是我希望 10-20 应该是绿色,80-90 应该是红色,其余应该是黑色.
Now the problem I am facing is that I want that 10-20 should be of green color and 80-90 should be of red color rest should be black color.
请帮助我是 iOS
的新手.
PLease help I am new in iOS
.
推荐答案
改变slider
的mimimum track
的color
@property(nonatomic, strong) IBOutlet UISlider *slider;
[self.fontSlider setMinimumTrackTintColor:[UIColor grayColor]];
这篇关于如何在 IOS 的 UI 滑块中添加不同的颜色?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文