我一直在尝试设置UIDatePicker
的字体和颜色,但是今天datePicker
中label
的颜色没有改变。我的应用程序中其他部分都相对容易调整,只有这个有些麻烦。有人知道如何做吗?
func updatedatePicker(){
DatePicker.setValue(UIColor.whiteColor(), forKeyPath: "textColor")
DatePicker.setValue(1, forKeyPath: "alpha")
}
在
viewDidLoad()
中:-DatePicker.addTarget(self, action: #selector(ViewController.updatedatePicker), forControlEvents: UIControlEvents.ValueChanged)