【发布时间】:2014-03-08 03:31:23
【问题描述】:
我正在尝试在 UISlider 上动态配置轨道颜色。
这行代码非常适合设置滑块轨道的低端。
[self.sliderBar setMinimumTrackTintColor:[UIColor redColor]];
当尝试对滑块轨道的高端执行相同操作时,这行代码会向调试日志报告 3 个致命错误。
[self.sliderBar setMaximumTrackTintColor:[UIColor redColor]];
<Error>: CGContextAddPath: invalid context 0x0. This is a serious error. This application, or a library it uses, is using an invalid context and is thereby contributing to an overall degradation of system stability and reliability. This notice is a courtesy: please fix this problem. It will become a fatal error in an upcoming update.
<Error>: clip: invalid context 0x0. This is a serious error. This application, or a library it uses, is using an invalid context and is thereby contributing to an overall degradation of system stability and reliability. This notice is a courtesy: please fix this problem. It will become a fatal error in an upcoming update.
<Error>: CGContextDrawLinearGradient: invalid context 0x0. This is a serious error. This application, or a library it uses, is using an invalid context and is thereby contributing to an overall degradation of system stability and reliability. This notice is a courtesy: please fix this problem. It will become a fatal error in an upcoming update.
我也尝试使用点表示法设置轨道色调颜色,但报告了相同的 3 个错误。
self.sliderBar.maximumTrackTintColor = [UIColor redColor];
我很困惑为什么正确设置了最小轨道色调颜色,而最大轨道色调颜色却被打破了。任何帮助将不胜感激。
这个问题似乎与this 问题有关,但我不能 100% 确定,因为我不使用图形(仅设置色调)。
【问题讨论】:
标签: ios objective-c ios7 uislider