Change UIDatePicker font color?

后端 未结 15 1797
南方客
南方客 2020-12-04 19:12

All I want to do is change the font color of the UIDatePicker. I\'ve researched other questions but they\'re all involving changing other properties and customizing the enti

15条回答
  •  一整个雨季
    2020-12-04 20:07

    It didn't work until textColor was set inside layoutSubviews()

    override func layoutSubviews() {
        super.layoutSubviews()
        datePicker.backgroundColor = .black
        datePicker.setValue(.white, forKeyPath: "textColor")
    }
    

提交回复
热议问题