leaner122
leaner122

Reputation: 657

Making UIDatepickerview font bold

I am trying to make font of UIDatepickerview bold and did not find any way of doing it.

I can change color of font as follows

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

but I have no idea how to make font bold like HeleveticaNeue-bold with size 16

Upvotes: 0

Views: 439

Answers (2)

Abhirajsinh Thakore
Abhirajsinh Thakore

Reputation: 1822

For future References:

Although it is suggested to use the Native(Default) UIDatePicker of the Swift, then also if anyone wants you can refer the following list

Following are some of the Customisable Datepicker from GitHub.

  1. https://github.com/squimer/DatePickerDialog-iOS-Swift
  2. https://github.com/itsmeichigo/DateTimePicker
  3. https://github.com/hsylife/SwiftyPickerPopover
  4. https://github.com/EngrAhsanAli/AAPickerView
  5. https://github.com/dillidon/alerts-and-pickers
  6. https://github.com/hughbe/day-date-picker
  7. https://github.com/alikaragoz/AIDatePickerController
  8. https://github.com/CooperRS/RMDateSelectionViewController
  9. https://github.com/zhhlmr/ZHDatePicker
  10. https://github.com/GasimGasimzada/FxDatePicker
  11. https://github.com/anatoliyv/SMDatePicker
  12. https://github.com/MarioIannotta/MIDatePicker

Note: But yes do not Try to customise The appearance of UIDatePicker.As it might make a danger of rejection of your app in future.

Hope this helps.

Upvotes: 2

Russell
Russell

Reputation: 5554

You cannot, and you should not do this.

Here's the relevant section from the UIKit documentation, https://developer.apple.com/documentation/uikit/uidatepicker

Appearance

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.

As Hermang suggests, if you need a customised version, you should use a third-party control, or customise your own, perhaps starting with UIPickerView - but that will mean a lot more work!

Upvotes: 0

Related Questions