UISlider setMaximumTrackTintColor

Я пытаюсь динамически настроить цвет дорожки на 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.

Я также попытался установить цвета оттенка дорожки, используя точечные обозначения, но о тех же трех ошибках сообщалось.

self.sliderBar.maximumTrackTintColor = [UIColor redColor];

Меня очень смущает, почему минимальный цвет оттенка дорожки установлен правильно, а максимальный цвет оттенка дорожки нарушается. Будем очень благодарны любой помощи.

Эта проблема, похоже, связана сэтот вопрос, но я не уверен на 100%, так как я не работаю с графикой (только настройка цвета оттенка).

Ответы на вопрос(6)

Ваш ответ на вопрос