Xcode 6.1. Uncheck and check back portrait orientation. Simulator never appears in portrait mode - ios

As we know "General" tab has "Device orientation" section where we can specify required device orientations.
The issue is next: when I once uncheck portrait orientation in Xcode settings, the simulator every time works in landscape mode, even if I checked portrait orientation back and reset all settings on the simulator.
Here is a video how it works: https://www.youtube.com/watch?v=gWDametoyks

The reason the simulator wants to run in landscape is most likely because of your "info.plist" file. The "supported interface orientations" array in the plist contains all of your supported interface orientations. Whichever orientation is first in that array is the one your simulator will default to when you run your application. Unchecking and rechecking an orientation (in the "General" tab) puts it at the bottom of the array, so the simulator doesn't use that orientation. It's an Xcode problem, not a simulator problem, which is why resetting the simulator didn't do anything. If you uncheck landscape and portrait, recheck portrait, then recheck landscape, the simulator will use portrait orientation. Hope it helps :)

Related

How can I force landscape for all views in Xcode

I tried to set the device orientation to landscape only (left & right) in the General tab of the target and also in the Info tab for iPad and iPhone, but portrait mode is still supported/enabled. Is this a Xcode bug or does anyone know why portrait mode is still supported even though I disabled it in both places? Preferably I would like to achieve it without setting it in code. I am using Xcode 13.
After playing around for a while I saw, that the portrait mode is still set in the Build Settings tab even though I disabled it in the General and Info tab. Just click on your Target -> Build Settings -> search for 'Orientation' and remove the portrait one if there is any.

Prevent display rotation on iPad

In Xcode in Device orientation section only "Portrait" is selected. On iPhone it works properly, when phone rotated to landscape mode it still works as portrait, so no changing. But on iPad (6th generation) when display is rotated to landscape mode actual screen in my app is also rotated, but without autoscaling. But I don't want that it will be possible to rotate screen on iPad. Do I need to fix it by code or some other settings on Xcode besides "Device Orientation" settings
So in the info.plist for your app you just gotta go to "Supported interface orientation (iPad)" open that section up with the disclosure triangle and delete the items you don't want to rotate to for the iPad!

Device orientation in Xcode does not seem to work properly

In my project I have only options "portrait" and "upside down" selected. The two of landscape options are not checked. But when I run it whether on a device or on simulator and turn it right or left the app becomes landscape. It should not, what could be wrong?
Ups, sorry i didn't noticed the iPad tab which also containes checkboxes with checked landscape

Why iPhone sill rotate after I uncheck the device orientation (delete rotation from info.plist file)

I don't check any device orientation on the Deployment Info page, that is, there is no entry in the Supported interface orientations on the Info.plist. However, the iPhone still can rotate to landscape. How can I disable iPhone rotation? Do I need to write some code in the view controller? Thanks in advance.
When you don't check any orientation, it defaults to all of them. To keep the orientation at only portrait, you must check the portrait only orientation.
You can toggle here in the device orientation section which orientation that you want your app to support:
Just set it to portrait and you'll be fine.

Set Landscape Orientation for iPad Only NOT iPhone

I have an iPhone Storyboard and iPad Storyboard in my xCode project. In my iPhone version, I only want portrait mode to work (which is already there).
Now, I have added a storyboard for iPad, but iPad is working only with Portrait mode. However, I want the iPad to work in Portrait and Landscape and the iPhone to remain as portrait only
Please advise.
Select your project -> Target -> Deployement info -> iPhone.
and checkmark as follow:
for iPhone:
And for iPad:
Select your Project from document directory.
Go to Targets->General->Deployment Info
Here you will have iPhone and iPad options with relevant orientation info.
Checkmark the orientations you want, specific to device.

Resources