Is there any way that we can Forcefully change app orientation from portrait to landscape while navigating ?
I have a requirement that while pushing controller from A to B. B should be in landscape but my A controller is in portrait.
Is there any way that we can Forcefully change app orientation from portrait to landscape while navigating ?
I have a requirement that while pushing controller from A to B. B should be in landscape but my A controller is in portrait.
from my experience on the last app in which I tried doing the same, I found answers on Stack overflow telling not to forcibly change the orientation in a Navigation based application.
this function will let you use the view controller in the desired orientation, in this case I've set it for landscape, and disallowed rotation in portrait modes.
You will face the problem of the B view controller loading first in the orientation on A view controller thou. So I changed the full orientation of the app to landscape. Hope this helps.
In
- (void)viewWillAppear:(BOOL)animated
say:... but first, in your xib, set your view's orientation to the desired one
In your ViewController-B add this lines of code in viewDidLoad:
This code is working fine if you are using navigation controller to move from A to B.
I have used this.
Hope this will help you.
Enjoy Coding :)