What appears in the YouTube application when switching from the movie information screen to the actual movie is not a navigation interface - it is a modal view. This always works reliably: if you show the view in the model (using presentModalViewController ), and it can be displayed in only one orientation, the application turns to that orientation.
So, the solution is to not move your landscape view to the navigation controller; present it as a modal view.
Ok, but maybe you want to trick the user into believing that we are still in the navigation interface? Then give a modal look to the navigation interface configured to look like the main navigation interface! Therefore, when you present a modal view, it will be displayed to the user as if the navigation interface has rotated (although there will be no rotation animation).
Now the only problem is that the navigation interface in the modal view does not have a back button if we look at its root view. This violates the illusion (and makes it difficult for the user to return). The solution to this is a trick: double-click on the landscape view in the navigation interface before presenting it as a modal view. Thus, what is displayed in the navigation interface is the second view on the stack, and therefore there is a back button. Then, in the delegate of the navigation manager, catch the "Back" button and release the modal view when the user tries to return to what is known to be the root level. So:
- (void) doButton: (id) sender {
source share