I try to customize the UIDatePicker in iOS14 but I'm unfortunately unable to do this. I want to change the background and border color of the UIDatePicker.
Here is my code in my class:
fileprivate let picker: UIDatePicker = {
let picker = UIDatePicker()
picker.translatesAutoresizingMaskIntoConstraints = false
picker.datePickerMode = .time
picker.preferredDatePickerStyle = .inline
picker.layer.borderWidth = 0
picker.minuteInterval = 15
picker.backgroundColor = .clear
picker.overrideUserInterfaceStyle = .light
return picker
}()
I want to change the background color of the inner gray part of the UIDatePicker to white or in this example to clear.
As you can see, the gray part on the white background doesn't really look good.
On note: I use the UIDatePicker in a UITableViewCell.
I hope you guys can help me and maybe there is only 1 or 2 lines which are missing in my code. :)
Best regards and stay healthy! Roman
