Changing text color of datepicker

前端 未结 8 2356
鱼传尺愫
鱼传尺愫 2020-12-01 15:57

Is it any way to change text color of datepicker in iOS8? I\'ve that it isn\'t possible in iOS7 and prior, something changed in 8th version?

For example I\'ve found

8条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-12-01 16:19

    Still Works, Swift 4 Update

    datePicker.setValue(UIColor.white, forKeyPath: "textColor")
    

    This works for me.

    datePicker.setValue(UIColor.whiteColor(), forKeyPath: "textColor")
    

提交回复
热议问题