A: 

Under normal circumstances, when displaying a new UIViewController it should automatically rotate to portrait if it only supports portrait and the app is currently in landscape. This only applies to newer versions of the OS (but I assume you're probably running on 3.1.3?).

In any case, to force the app into portrait:

[[UIApplication sharedApplication] setStatusBarOrientation:UIInterfaceOrientationPortrait animated:YES];
Ed Marty
I tried that but it doesn't work. It moves the status bar, but the navigation bar is still in the wrong place and the view is still rotated.
progrmr
How is the navigation controller displayed? Is it the root view controller initially added to the window? Or is it presented in some other way? Do all of the parent view controllers support rotating to portrait? And how is the color picker displayed on the navigation controller? Is it the root view or pushed on to an existing controller?
Ed Marty
The nav controller is the root VC added in the app delegate. All of the view controllers support portrait and landscape except this one. The color picker is displayed by calling pushViewController:animated: on the nav controller. The root and parent view controller are in landscape orientation at the time the color picker is pushed.
progrmr
A: 

I think that it is not possible to push a portrait view controller to navigation controller that is already in landscape mode.
Try to imagine its animation (the navigation bar)...

I would suggest you to add a landscape mode for your color picker.

Another solution might be to rotate the entire view when entering to the color picker in landscape mode.
You can take the current orientation by [[UIDevice currentDevice] orientation].

Michael Kessler
You may be right, but if you push the UIImagePickerController (which only supports portrait) from a landscape view, it does animate properly and slide in the picker with navbar in the portrait orientation. Perhaps they are using internal APIs to accomplish this though or it might have something to do with the fact that the UIImagePickerController is also a UINavigationController.
progrmr
+2  A: 

If it works for your app, you could consider using a modal view controller instead. IIRC presenting a modal view controller does handle rotating properly.

Johan Kool
Bingo!! That works, it gets oriented and laid out in portrait. There's no nav bar but that's easily dealt with.
progrmr