Loading a UIDatePicker in Landscape on a UINavigationController

Posted by Ryan on Stack Overflow See other posts from Stack Overflow or by Ryan
Published on 2009-07-06T17:17:42Z Indexed on 2010/03/12 19:57 UTC
Read the original article Hit count: 423

I have a custom UINavigationController that supports auto-rotate. I also have a UIDatePicker on one of my views that I throw onto the stack of the Navigation controller. The auto-rotate works if I start the date picker view in portrait and then rotate it. If I try load the date picker view in landscape to begin with, the view is all messed up. It looks like it would if it didn't support rotation and the frame only has about half of the picker visible and off center.

I've tried making my own date picker that supports auto-rotate in case that was the problem, I've tried creating two different views and swapping them out, and I've tried changing the view frame size on the ViewWillAppear method. None of them seem to be working for me as of yet.

Anyone have any suggestions on how to get the date picker to show up in landscape correctly on a navigation controller? I probably am overlooking something simple and the answer is right in front of me, but I'm not finding it.

© Stack Overflow or respective owner

Related posts about uinavigationcontroller

Related posts about uidatepicker