Hi all,
like many others im having problems implementing forced landscape rotation.
My app allows a user to select/take a photo. If the photo was taken in landscape orientation then I
force the user to view it in landscape orientation.
I have finally come up with a hack that allows me to do this.
The hack involves removing the navigation controller from the window and adding the landscape view
controller directly to the window which allows the landscape view to override the shouldAutorotateToInterfaceOrientation.
In order to allow the landscape view controller to be navigated to by the navigation controller
I push a "placeholder" view controller onto the navigation controllers stack and the moment it
displays, I remove the navigation controller from the window and add the landscape view
directly to the window.
The landscape controller has its own navigation controller in order to maintain consistency with
the rest of the app. When back is pressed I simply remove the Landscape controller from the window
and then re-add the original navigation controller to the window and pop the placeholder view from
it to prevent the landscape view from being loaded again.
This all works but looks horrible!
What happens is this: After the user has selected a landscape photo, the top status bar rotates to
landscape orientation straight away, but unfortunately the menu bar and the rest of the photo album screen stay in portrait orientation.
After a few seconds my landscape view controller loads and displays the picture as it should.
But for these few seconds after selecting a photo the screen looks foul with mismatched status bar orientation.
I have overidden the drawRect method of the view that draws the landscape image and it seems that it is the call to [image drawInRect] that is causing the problem because it takes so long!
If i remove this call, then the screen switches instantly to my landscape view controller with no horrible unprofessional looking lag, but obviously the picture doesnt get drawn which isnt much use
Please see the screenshot that i have attached as it probably explains the problem much better than I can with words!
In the photo you can see that the status bar has prematurely rotated itself to landscape whilst the rest of the screen stays put in portrait.
*EDIT (HAVE ADDED A ZIP FILE INCLUDING THE PHOTO BECAUSE PHOTO DOESNT SEEM TO WORK!)
If anyone could offer a solution to this problem I would be extremely grateful
Thanks in advance

,
Chris.