There are about 10 different UIViewControllers in my app, one of which I want to switch to landscape mode if the device rotates Got it (Everything else, I want to put in the picture.)
To apply rotation to that one scene, I needed to implement the 'needout' method of my controller and yes back. Since this view is being accessed through the Navigation Controller, I also need to create a sub-section of the UnaVision Controller, which applies the 'shoulderotate' and returns yes.
This solution works, but very well. I think all the UIViewControllers respond to the rotation I push on my subclass of UINavigationController, even if I apply 'sophisticated' and no return withdrawal. (Remember: I only have to answer the rotation to a particular UIViewController, not every one in the navigation controller's stack.)
So, my question is: How do I do this? All the solutions I can come with 1 are cumbersome, and 2) worse, does not seem to work.
Thank you very much.
When you implement the UIAgentrolorrator, this class is your parent who looks at all children The controllers who will be pushed into the stack Therefore, the RootViewController is the only controller that does not say yes or no for the replacement. Even if you are going to go to auto-rotation to see the controller, then they do not count!
This is the nature of the UIA controller. So to change this, you have two options:
1 - Manipulate it manually, for which you have to go through some cumbersome codes.
2- Change your design so that it is more relevant to UINavigationController that one view should be rotated, which is not called RootviewController (Navigation Route View Controller - they are given the same name, but Is completely different), which hosts the newcomer and when the device rotates, it will either push NavController in the second view. 3- The second method, whatever works, but is not recommended because it violates the concept MVC, it is that your NavController can listen to information, especially this child. See that you can rotate and put a notification - eg. RotateMe, and when NavController hears it, it revolves.
As I said, this will work, but it violates the MVC model - which is fine for Apple, but from a programming perspective
If any further clarification is required, please let me know.
Comments
Post a Comment