[Swift] UIDatePickerの色を変える
@IBOutlet weak var myPicker: UIDatePicker!
override func viewDidLoad() {
super.viewDidLoad()
myPicker.backgroundColor = UIColor.white
myPicker.setValue(UIColor.white, forKey: "textColor")
for subview in myPicker.subviews.first!.subviews {
if subview.frame.height < myPicker.frame.height {
subview.layer.borderColor = UIColor.white.cgColor
subview.layer.borderWidth = subview.frame.height
}
}
}