How to get UINavigationController to rotate, but not the subview?
I downloaded the free iPad application "SketchBook Express" by "Autodesk".
In it, they have a drawing surface, and (what I believe is) a UINavigationController
. What interests me is that the navigation controller bar rotates with the iPad, but the content of the drawing does not. So if I put the iPad from portrait to landscape, the nav bar moves to the new top, but the sketch I've drawn is now on its side. I would like to implement something similar for my program, but I have been unable to.
I've played with shouldAutorotateToInterfaceOri开发者_StackOverflow社区entation:
but so far I've just figured out it is only called once. I made a subclass of UINavigationController
and had that return YES, and had my subview controller return NO. That did not do the trick.
Is there a simple way to do this?
What rotates is probably contained by a UIViewController (or UINavigationController)'s view.
Other things (that don't rotate) are probably contained by a view that is not contained by any UIViewController (or a controller that returns NO in shouldAutorotateToInterfaceOrientation
method).
This means that you could try setting your drawing view as a subview of the keyWindow. Other things could be in the view controller as usual.
Is not I have tried, this is just an idea. And I would be interested in knowing if this worked. :)
精彩评论