Portrait mode on iPad?

How do I configure an iPad app to only work in portrait mode?


In Xcode there are checkboxes for the four orientations, and only Portrait is checked, but the app still rotates into landscape mode.


I also tried checking the "Requires full screen" box, but this didn't have any effect.


Thanks,

Frank

Replies

I found this when I opened my info.plist file:


  <key>UISupportedInterfaceOrientations</key>
  <array>
  <string>UIInterfaceOrientationPortrait</string>
  </array>
  <key>UISupportedInterfaceOrientations~ipad</key>
  <array>
  <string>UIInterfaceOrientationPortrait</string>
  <string>UIInterfaceOrientationPortraitUpsideDown</string>
  <string>UIInterfaceOrientationLandscapeLeft</string>
  <string>UIInterfaceOrientationLandscapeRight</string>
  </array>


Is this some new thing where Xcode is forcing iPad apps to have all orientations or am I misunderstanding the UI? I don't see a way in the project settings to specify iPad orientations separately. I was able to solve my problem by editing this file manually.

  • I had the reverse issue. I had an app that I had originally set up to be portrait only. When I added landscape in Deployment Info screen, landscape worked on iPhone but not on iPad. I had to edit the Info.plist file to add the other orientations. Then it worked.

Add a Comment

Curious which launch images are in play...

I observed a strange behavior.


I had defined iPhone and iPad as targets.

With 4 orientations (cannot distinguish in Targets > General)


They did appear correct in pList.

If I removed some orientation, only iPhone entry was modified in plist.


So I selected iPad target only and removed orientations except Portrait

plist showed it corrctly.


But when I added back iPad, I could not get other orientations back for iPad.

I had to reintroduce by adding ➕ in the ipad orientation entry (directly in plist, no need to go to xml format).


Seems a bit buggy here.