[Swift] Change the textColor of UIDatePicker

The textColor of UIDatePicker cannot be changed from the property on Storyboard

Since it could not be changed from the property on Storyboard, it was supported by the following code.

datePicker.setValue(UIColor.white, forKey: "textColor")
datePicker.setValue(false, forKey: "highlightsToday")

image.png The text color change is reflected as desired.

If highlightsToday is not set to false

datePicker.setValue(UIColor.white, forKey: "textColor")

image.png If highlightsToday was not set, the text color change was not reflected in the Today part.


UIDatePicker Change color of text of “today” date

Recommended Posts

[Swift] Change the textColor of UIDatePicker
[Swift] Change the color of SCN Node
The basic basis of Swift dialogs
[Swift] How to dynamically change the height of the toolbar on the keyboard
[Swift] Determine the constellation from the date of birth entered in the UIDatePicker
[Swift] Vaguely grasp the flow of Delegate
[Eclipse] Change the color of the vertical ruler
[Swift] Termination of the program by assertion
Bootstrap4 Change the color of the hamburger menu
[Swift] Get the height of Safe Area
[Rails] Change the label name of f.label
The basic basis of Swift custom cells
[swift5] How to change the color of TabBar or the color of item of TabBar with code
Change the URL of the application of Eclipse project (Maven).
Change the timezone of the https-portal container to JST
How Microservices Change the Way of Developing Applications
[AndroidStudio] Change the color of the ActionBarDrawerToggle hamburger menu
Change the location folder of Docker image & container
[Swift] Termination of the program by the fatalError function
[Swift] How to change the order of Bar Items in Tab Bar Controller [Beginner]
[Swift] Get the number of steps with CMP edometer
The world of clara-rules (2)
Judgment of the calendar
<Android> Change the background color of the List row of ListView
The world of clara-rules (4)
The world of clara-rules (1)
[Rails] How to change the column name of the table
The world of clara-rules (3)
[Rails] Cancel / change the default password validation of devise
[Swift] This is the solution! Illustration of Delegate implementation
The world of clara-rules (5)
The idea of quicksort
Change the storage quality of JPEG images in Java
Find the approximate value of log (1 + x) in Swift
[Swift] How to get the document ID of Firebase
The idea of jQuery
Now, I understand the coordinate transformation method of UIView (Swift)
I want to change the log output settings of UtilLoggingJdbcLogger
[Swift] I tried to implement the function of the vending machine
[Swift] Lightly introduce the logic of the app that passed the selection
Change the file name and output destination of the JavaVM error file
How to change the setting value of Springboot Hikari CP
[Rails] When the layout change of devise is not reflected
How to change the contents of the jar file without decompressing
[Swift] Get the timing when the value of textField is changed
When you want to change the MySQL password of docker-compose
How to change BackgroundColor etc. of NavigationBar in Swift UI
About the handling of Null
[Swift] Simple implementation of UIImageView
[Swift] Types of types-Basic knowledge-
Docker monitoring-explaining the basics of basics-
Change the port with SpringBoot
[Swift] Implementation of ultra-simple billing
About the description of Docker-compose.yml
Understand the basics of docker
The play of instantiating java.lang.Void
Explanation of the FizzBuzz problem
The basics of Swift's TableView
[macOS] [Cocoa] [Swift] Change IME
Median of the three values
The illusion of object orientation