4

When I add a UIDatePicker into the content view of a UITableViewCell in a storyboard, the hour is missing. This does NOT happen for some reason if I add the UIDatePicker programmatically.

Here's a screenshot (notice the hours missing):

UIDatePicker Bug

This is very similar to the problem brought up here except I am not messing with UIAppearance at all.

Community
  • 1
  • 1
pixelfreak
  • 17,714
  • 12
  • 90
  • 109

3 Answers3

0

In the XIB file click on the date picker and then look over in the right menu and you can customise the date picker options.

Would probably be worth checking you have got it set to the correct type: Date and Time and nothing else has gone wrong.

Otherwise I would recommend deleting your current one and adding a new one from scratch as that looks very odd

enter image description here

sam_smith
  • 6,023
  • 3
  • 43
  • 60
-1

You can refer this LINK.

datePicker.datePickerMode = UIDatePickerModeDate;

UIDatePickerModeDate

The date picker displays months, days of the month, and years. The exact order of these items depends on the locale setting. An example of this mode is [ November | 14 | 2014 ].

-1

Call sizeToFit method to fix this.

Bartłomiej Semańczyk
  • 59,234
  • 49
  • 233
  • 358