I haven't found a "proper" solution for this problem short of abandoning UIDatePicker
or [UILabel appearance]
, but I did figure out a hack that at least hides the problem. It seems that when the view is initially loaded, the UILabel
s holding the text for the selected date may be drawn using the label's appearance proxy, but when the UIDatePicker
redraws after having the date reset, it will set the label back to the system font.
To hide the problem, in viewWillAppear:
, I set the date to two different date values with different date components, then set the picker back to the proper date, like so:
[datePicker setDate:[NSDate dateWithTimeIntervalSince1970:0] animated:NO]; //1970-01-01
[datePicker setDate:[NSDate dateWithTimeIntervalSince1970:49000000] animated:NO]; //1971-07-22
[datePicker setDate:myDate animated:NO]; //Set back to the correct date
It's not elegant, but it makes the date picker look normal again.