views:

29

answers:

1

I have a UIDatePicker using UIDatePickerModeTime that I use in an iPhone app modally, works fine:

alt text

Using this same basic code for iPad, but putting the view in a UIPopoverController gives some pretty inconsistent results. My desired mode (UIDatePickerModeTime) plus the other three modes are shown below. Notice how 2 of them are not rendering at all, but instead have no content

UIDatePickerModeTime

alt text

UIDatePickerModeCountDownTimer

alt text

UIDatePickerModeDateAndTime

alt text

UIDatePickerModeDate

alt text

What could be causing the UIDatePickerModeTime and UIDatePickerModeDateAndTime modes to go haywire?

+1  A: 

Instantiating the UIDatePicker with CGRectZero was the culprit. Even though the code worked on iPhone, and I call sizeToFit explicitly on it to set the size, changing the CGRectZero to CGRectMake(0,0,320,160) was what got it to display. Go figure.

coneybeare