
Rotating UIPickerView between landscape and portrait orientations
One of the UI improvements in the first update of Niftybean's index cards app iSpeechCards is support for both landscape and portrait orientation when editing card content. When editing a card's duration there's a custom UIPickerView displaying hours and minutes. This picker is positioned at the bottom of the screen and also scales and stretches in landscape.
Here's the simplest way I've been able to achieve this using Interface Builder layout and minimal code in the view controller. For this example I'm using a UIDatePicker but any UIPickerView will work.
The quick solution
Use this quick solution if you don't mind the UIPickerView height staying at the default 216 px.
- Create the elements and hook them into your code using IBOutlet
- Support both orientations in the view controller.
- Adjust the resizing mask in viewDidLoad:







