Landscape mode without a ViewController
I have a project based on a window-template, so it doesn't have a viewController. Now I'm trying to make this work in landscape only, and I have set the "supported device orientations" to "Landscape (right home button)" only, just the way I want it. The app actually launches in Landscape mode, but when I want to show an image which is btw a landscape-fullscreen one, iOS draws it in Portrait mode, cutting off what doesn't fit. Well I know the option of implementing a Vi开发者_开发问答ewController and editing the "shouldAutorotate..." method, but I want to do it without. I have one solution in my mind, but I'm not sure whether it#s such a great idea: Rotate the whole coordinate-system on app-startup manually using "CGTransform..."
Down that path lies madness. Just because the template doesn't include a built-in UIViewController
doesn't mean you can't add one yourself.
Add one, and save yourself a bazillion headaches.
From a more technical standpoint, a lot a UIKit expects the window to have a UIViewController
, and not having one means you can lose out on a whole lot of behavior that you would otherwise get for free.
精彩评论