Device orientation strange behavior - ios

I have my Universal app ready and I set the device orientation to portrait only.
On the iPhone it's okay - only portrait, but on the iPads it is still can rotate to landscape. I double checked that I unticked the landscape left/right and left only portrait.
Actually it's not a big problem for me, because I use Auto Layout and it still looks okay when in landscape but maybe somebody can provide a reasonable explanation.
I use:
objective-c
XCode 6.1.1
testing devices iPhone 5c and iPad mini with Retina display

If somebody have a problem like I described above, just check the device orientations you need in ALL possible variants like iPhone/iPad/Universal.
Thanks #LyndseyScott

Related

Is there a way to ensure iPad Simulator landscape screenshots are rotated correctly?

Most of the iPad apps I develop are used in Landscape mode. The iPad Simulator always starts in Portrait mode; with ⌘+R I rotate it to Landscape mode. In the past (before iOS 13.0 or 13.1), screenshots made with ⌘+S had the correct rotation, but if I make a screenshot right now it's rotated by 90 degrees.
(click to enlarge)
This is how the Mac desktop looks like when I make the screenshot on the Simulator:
Is there a way to stop this behaviour? I've tried the menu option Hardware -> Rotate Device Automatically but that didn't help.
This issue seems to have been fixed with the release of iOS 14 / Xcode 12. Now, when I take a screenshot of my Simulator in Landscape mode, it is saved in Landscape orientation.

ipad device screen orientation is not correctly when it is rotate

I'm working on this iPhone app, whose orientation works all fine except first screen. The first screen also works fine if the device is in portrait orientation, but not for landscape orientation.
Interestingly, if I rotate device at the first screen, it also adjust well.
The problem looks to me is that the app always assumes the device is in portrait orientation, so the first screen is always shown in portrait orientation even if the device is in landscape orientation.
what can i do to solve this.
Thanks, Please help Me
This nugget package may help you:
https://www.nuget.org/packages/Xam.Plugins.Forms.DeviceOrientation/
So can check which orientation the device is.

IOS Simulator behaving correct?

Starting the IOS Simulator for IPhone 6s does appearing the device in portrait mode.
Then when I rotate the device with Hardware->rotate, then the device rotates, but the content not.
Is this the way in behaves in reality ?
I am asking, because I can't test the rotation correctly.
When I start my app, then things which should be centered appearing not in the center. Should content rotation not be managed by IOS. Do we have to care of these things?
UPDATE
Added a new Scrrenshot.
Good to know that the Iphone's default screen is not rotating.
This leads to the following question :
But is the following correct. When the device is in landscape mode, the app (rotable app) starts in portrait and immediatelly rotates to landscape. So we have to handle the rotation change at start of the app ?
Please goto project ->targets->General goto Deployment Info section and check Device orientation

Orientation issue in iOS 7.1 or iPhone landscape

I am developing an app support iOS 6.0 and up and only in landscape mode for both device.
I have an issue in splash screen/launch screen for landscape mode, I have used 2 approach but didn't work properly.
Approach 1: When I use Images.xcassets to set Launch images. It work fine in iPad device of any OS but don't work in iPhone device as specially in 4" screen phones and 4.7" screen phones.
I have attached image of Images.xcassets as below:
Approach 2
Now because of above problem, I have used lauchscreen.xib for iPhone and iPad. Now problem is, when i use this approach, Splash screen display as a portrait mode rather than landscape in iOS 7.1 only.
Supported Device Orientation:
I was shock when I read this and heard about it..
Till iOS 7, Apple don't support Landscape mode for iPhone and iPod. Apple supports Landscape mode only for iPad.
So what if we develop app and give support from iOS 6 / iOS 7?
Solution:-
In Images.xcassets, select iPhone for portrait mode and add rotated image with 90 degree.
Let's understand with Step by step process :-
Suppose you have image with 480x320 dimension image.
Open that image in preview(Image editor)/photoshop.
Now rotate that image and save it.
Add rotated image at respective place in Images.xcassets.
Clean Project and run.
Please make sure your orientations are set appropriately. Also please refer this link for more details :- iOS 6: How do I restrict some views to portrait and allow others to rotate?

Universal app and landscape orientation for iPad

I want to design a universal app that I'd want to support just portrait orientation. It's weird because Xcode allows you to select portrait orientation only in the target's Deployment Info settings (and in Info.plist), but reading the iOS Human Interface Guidelines, in the section regarding the launch images, I've found this:
You must provide at least one launch image. Typically, an iPhone app includes at least one launch image in portrait orientation; an iPad app includes at least one launch image in portrait orientation and at least one launch image in landscape orientation.
Does that mean that you have to provide a launch image in landscape orientation even if you only support portrait orientation? Or is it required to support landscape orientation in iPad?
Thanks
EDIT: It looks like it is not required to support both portrait and landscape orientations in iPad, though strongly recommended. However, it looks like, if an orientation supported, also the opposite one should be (portrait and upside-down, for instance). Is it required then to provide both launch images? (portrait and upside-down). Thanks again
It is strongly recommended that your application support all orientations. This includes portrait, portrait upside-down, landscape left and landscape right. iPad apps that require an orientation must support both variants of that orientation.
https://developer.apple.com/library/ios/qa/qa1588/_index.html

Resources