I am testing an application on iPad Simulator and I need it to start my app in the position the simulator is but every time I run the app, the simulator rotates to portrait.
Is there a way to stop this behavior?
thanks.
= = = =
last time edit: I discovered now that if I return NO on shouldAutorotateToInterfaceOrientation, the problem stops. But this is insane because shouldAutorotateToInterfaceOrientation should rotate the interface to match the iPad position, not the contrary.
I had this problem when running the GHUnit test app in the simulator. I fixed it by adding this to the info.plist
file:
<key>UISupportedInterfaceOrientations~ipad</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationPortraitUpsideDown</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
If you edit this using Xcode's plist editor, make sure you have the "Show Raw Keys/Values" option turned on.
The iPad supports multiple launch images (as opposed to the iPhones singular default.png) so that an application can be launched in all rotations. Specifics here
I'm guessing that you are missing the new ones (default-landscape.png etc) so that when the application loads it can only find the portrait loading screen and therefor triggers a rotation (and the simulator responds by rotating to portrait). When you have shouldAutorotateToInterfaceOrientation
return NO
, it still can't find a landscape image but doesn't allow the rotation to take affect?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With