Search code examples
swiftxcodeuidatepicker

Make UIDatePicker Visible Against Black Background


I've got an app with a date picker against a black background. Before the picker is clicked, it is almost invisible. Is there a way to make it opaque or easier to see? I've messed with the parameters, but nothing seems to do the trick. Thanks in advance!

Difficult to see unclicked date picker

Clicked date picker


Solution

  • Like this:

    myDatePicker.overrideUserInterfaceStyle = .dark