4

I'm trying to change font size and color in UIDatePicker. To changed colour I used UIDatePicker().setValue(_, forKey: _) and it was enough. I thought that changing size fill be also that easy, but keyPath "fontSize", "textSize" and other don't work... Someone know what is a keyPath for fontSize in UIDatePicker and how to find every keyPath for some classes?

Cheers, Jakub

jLaszczewski
  • 99
  • 1
  • 6

1 Answers1

5

You actually can't change the appearance of a UIDatePicker:

You cannot customize the appearance of date pickers.

- UIKit User Interface Catalog

And from the documenation:

The appearance of UIDatePicker is not customizable.

You should integrate date pickers in your layout using Auto Layout. Although date pickers can be resized, they should be used at their intrinsic content size.

You would have to create your own custom date picker.

Caleb Kleveter
  • 11,170
  • 8
  • 62
  • 92