Reputation: 4584
We're writing an application that's in landscape mode exclusively. We use a transform on a root view to rotate it to LandscapeRight, then every view that gets loaded by that view shares the coordinate system. That's all fine and dandy, except one of our views has a UIWebView object that's being loaded by a view controller. The site that we're trying to look at doesn't have its content filling the view. When I view the same site in mobile Safari in landscape mode, it looks correct. My guess is that the View Controller we're using to host the WebView still thinks it's in portrait mode, as querying the interfaceOrientation of the property returns "1"...is there a way to trick a view/view controller to think it's in a specific orientation?
Upvotes: 6
Views: 9396
Reputation: 3721
Hopefully you've already found an answer for this, but you might try telling your app to just start out in landscape mode, rather than forcing it to always rotate to that orientation. Then if your root view's shouldAutorotateToInterfaceOrientation returns yes only for landscape modes, I'd bet you'd have the behavior you're looking for.
This guy seems to have a good tutorial about how to do all that. http://www.dejoware.com/blogpages/files/iphone_programming_landscape_view_tutorial.html
Upvotes: 12