我将如何更改UIDatePicker中文本的颜色?我不想使用UIPickerView,因为我不想处理其日期/时间方面的实现,但是,如果存在一个等效的UIDatePicker作为UIPickerView的预先编写的实现,那么我很乐意它。
注意,我正在使用Swift 5。
Still Works, Swift 5 Update
datePicker.setValue(UIColor.white, forKeyPath: "textColor")
这对我有用。
datePicker.setValue(UIColor.whiteColor(), forKeyPath: "textColor")