I have a UIWebkit based app. I want to change the orientation of the webkit when user clicks on a button. I am fine with reloading the html inside the webkit after changing the orientation.
If I remember correctly, changing the status bar orientation will rotate the window to match the orientation defined for the status bar, even if the bar is hidden. This worked when I first tried it in iOS 4, but I have not tried it in iOS 5 at all.
Here's the command that does this:
[[UIApplication sharedApplication] setStatusBarOrientation:(UIInterfaceOrientation) animated:(BOOL)];