How to rotate an iPhone app when used on an iPad in landscape - ios

Devices is set to "iPhone" under Deployment info. In my Info.plist I have iPhone as Portrait only, and iPad as all 4 options. My app works fine on iPhone (no rotation as expected). It behaves the same on an iPad (no rotation) but of course then to view the app properly I have to hold the iPad like an iPhone with the Home button at the button. I don't want to have to do that. What I want is when the iPad is in landscape, e.g. with a keyboard, for the app to rotate but maintain its iPhone-like appearance, smaller, in the center of the display. How to achieve this?

Related

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!

Launchscreen rotation not working on iPhone 6s and smaller screens

I have a launchscreen storyboard with an ImageView and two labels all with some constraints to align the objects relative to the size of the screen.
When i choose a device with a screensize of an iPhone 6s or smaller in the simulator and rotate the device in landscape mode the view is not rotated.
When selecting an device with a larger screensize, e.g. an iPhone 6S Plus, the launchscreen is rotated correctly in landscape mode. Also when running it on an iPhone 6 the launchscreen is not rotated.
Any suggestions how to resolve this?
Maybe got a little bit closer to the cause. When rotating an iPhone 6 Plus or larger to the left in the Simulator, the dock icons are rotated. These are not rotated when rotating a device with a screen size equal or smaller than the iPhone 6.
I do not believe it is possible to rotate the LaunchScreen.
On the Apple Developer site: https://developer.apple.com/library/ios/documentation/UIKit/Reference/UIViewController_Class/ in the section on "Handling View Rotations" there was this line:
At launch time, apps should always set up their interface in a portrait orientation. After the application:didFinishLaunchingWithOptions: method returns, the app uses the view controller rotation mechanism described above to rotate the views to the appropriate orientation prior to showing the window.
So it looks like your main storyboard will get invoked before orientation can be taken into account.

How to disable portrait orientation for Ipad in swift 2 and xcode 7

I have been having this issue with the layout orientations specifically with ipads. In xcode, I clicked on the project itself in the left panel and disabled portrait layout. This worked for iphones and ipods but not ipads. The application is run on any ipad, the portrait mode is enabled. When turned to the portrait orientation in an ipad, my layout gets squished together and looks very bad. Is there anyway I would be able to only allow the devise orientation to be landscape on every device?
Here is a screenshot of the settings I have

iPad scales iPhone app incorrectly

When I run the app on the iPad it uses currently the 4 inch screen which does not fit on the screen of an iPad, the app is an iPhone only app, but I want to run it on the iPad with scaling up the 3.5 inch screen.
How can I force the iPad to use the 3.5 inch screen and not the 4 inch?
And also the status bar is shown on the iPad and not on the iPhone, why is that also different?
The status bar on iPad in combatibility mode is completely outside of your reach. It's displayed on the edge of your screen not on the edge of the application window. This behavior cannot be modified by the application. Logically, you need the normal iPad status bar and you can't have another in the application. On the other hand, there is no reason to hide the iPad status bar because it can never overlap the application in compatibility mode.
The 4-inch is strange because iPads always show iPhone applications as 3.5 inch. If you see bad dimensions on the screen, then it's a bug in your code. Make sure you are setting frame sizes correctly.

Interface orientation (Landscape) on iPad weird behaviour on ios 6(xcode 4.5)

I am building a word game app for iPad. I want it to run only in Landscape mode.
1. I have enabled only Landscape in plist settings.
2. The rootview controllers view is also set Landscape.
The issue is when I run it on simulator (ios 6.1), it runs in proper Landscape mode but when I run it on iPad the views are messed up and rotated 90 degree anti clockwise. Do I need to do something else in order to have it run properly on iPad device.

Resources