I’m a new iOS programming and I’m developing a simple iPhone game that needs to run in landscape only. I’ve …
- set supported orientations in the target settings
- added the req. plist item (initial interface orientation)
- overridden shouldAutorotateToInterfaceOrientation to return YES only for landscape modes
.. and the app “looks” correct, but there are a few odd things going on.
Issue 1 – I’m trying to manually position my views and not rely on autolayout. I’ve got a UIView in a NIB that I’m loading that needs to be positioned 150px from the right edge of the screen. I have to get the UIViewController’s view’s height (not width) to correctly position it – like it’s not rotated to landscape at this point in the code.
Issue 2 – Implementing a UINavigationController to go from the title screen to the game interaction. When I’m pushing the interaction UIViewController to the stack, it slides in from the right like it’s supposed to. When I go back to the title by popping the interaction, it slides UP to the title. It’s seems like it’s rotating back to portrait?
I think there is something very basic that I’m missing, but I can’t find it in my app code. I’ve gone over the lists for a landscape app but they don’t mention more than the list above.
Are there any other things/settings/methods to override that I should be on the look out for?
You need to set shouldAutorotateToInterfaceOrientation in your other viewControllers as well. Especially the ones displayed inside your UINavigationController.