iOS launch screen will appear in portrait instead of landscape - ios

I am creating an iOS app that will support iPhone and iPad in landscape and portrait orientations. I have setup my launch screen storyboard with an ImageView and that appears correctly in both landscape and portrait modes in Interface Builder. However, even though I am holding my phone in landscape, the launch screen will always appear in portrait. I have logged my device current orientation in application didFinishLaunchingWithOptions, but it reports UIDeviceOrientation unknown. After the launch screen disappears, the first view appears in landscape as expected.
Do you know why that happens and how to fix it?
Thanks

I think that you haven't open this:

Related

IOS Launch screen storyboard shows up in different orientation

I have an IOS app built with XCODE 11 which is landscape only(right+left).We are trying to move from Legacy launch images to Story board Launch screen.
The issue seems to be that the new launch screen appears as expected in landscape mode but when the device is in portrait orientation, the launch screen also appears in portrait , which looks weird because the image is meant to be in landscape to match the app orientation.
Note: The app launches in landscape after the launch screen irrespective of how the device is held.
Is there a way to lock the launch screen orientation to match the app (Landscape left+right)?
Been stuck on this issue for a while, appreciate any inputs :)
Have you tried set Supported interface orientations landscape in your info.plist only ?

How do you launch an iOS app in the current device orientation?

I'm working with Xamarin and am having troubles launching my app in the current device orientation.
I have a UINavigationController that I set on my main UIWindow as the root controller. I created a custom UINavigationController which overrides the methods :
GetSupportedInterfaceOrientations
and
ViewWillTransitionToSize
If I hold my iPad in landscape mode and start the app, it will start in portrait mode and then rotate in landscape. I'd like to make it start in the same orientation as the device's physical orientation. From the doc I've read it seems that since iOS 8, everything related to rotations should be handled in the root uiview controller which is my custom UINavigationController.
And here's my problem... let's say I want to start my app in the current device's orientation and then block everything except Portrait once the app is loaded. I tried the 2 following solutions and none worked.
1- I put all interface orientations available in the supported interface orientations key in the info.plist file. I launched the app while holding the iPad in landscape mode. In this case, my app starts in the same orientation as the device which is cool. What is not cool is that it doesn't call my navigation controller method GetSupportedInterfaceOrientations anymore. So even if I change the return value of that method to Portrait only later one, it does absolutely nothing since the method is never called anymore.
2- I removed all supported interface orientations from the info.plist file. I lauched the app while holding the iPad in landscape mode. In this case, my app starts in portrait mode and then rotates to landscape. I want to prevent the rotation and just start the app in the current device's orientation (landscape). With this setup though, I can later change the supported orientation as the navigation controller method GetSupportedInterfaceOrientations is being called everytime we try to rotate the app.
In apple's doc, it says "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."
The part where the view rotates to the appropriate orientation PRIOR to showing the window doesn't seem to work for me. It shows the window and then rotates it after.
So how do you launch an app in the current device's orientation (without the user seeing your first view rotate from portrait to whatever) and then be able to change the supported orientations later in the app? Example : I hold my iPad in landscape mode. I launch my app. First view I see is already in landscape mode. I can then rotate my iPad to change the view in portrait/landscape back and forth. Then I click a button which changes the supported orientation to Portrait which prevents me from changing the orientation to Landscape anymore.
Thanks!

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.

iOS8 lock view controller orientation

I have 2 root view controllers ViewController1 and TabBarController1(there are reasons for making 2 root view-controllers). ViewController1 only supports Portrait mode and TabBarController1 supports all orientations. ViewController1 appears first after launch. I am locking the orientation of ViewController1 using the following method.
- (NSUInteger)supportedInterfaceOrientations
{
return UIInterfaceOrientationMaskPortrait;
}
The app launch and orientation worked fine with iOS7.
When building the app through Xcode 6 in iPad(iOS8) following change is observed:
- When app is launched in landscape mode, ViewController1 with orientation locked into portrait mode appears with half black screen and when TabBarController1 appears which supports all orientations, doesn't resize with proper dimensions on changing orientations.
I have also tried overriding the above method in TabBarController1 to support all orientation but nothing works fine.
This problem is not observed when launching the app on iPad in portrait mode.
There is no problem when launching the app on iPhone as iPhone launches only in Portrait mode.
What is the issue when working with iOS8 ?
I am a newbie, so don't judge..
In ios8, apple changed 2 things :
1-
[[UIscreen mainscreen] bounds].size
This used to be a fixed value for portrait and landscape, now it is not.
When u change from landscape to portrait the width and height switch.
2-What is happening with you. You cannot force a viewcontroller to be in portrait only if you set portrait and landscape in project settings, do not know why, so you maybe have to set portrait only in project settings for example..
This is happening on iPads and iphone 6+ only.
Hope this helped..

Do you need a landscape iPad launch image for app thats just portrait

I have made me app so that device orientation is portrait only, however there it still has a place to put landscape launch image. Will I have to have one? If so can I just have a rotated version of the portrait one (i.e. this will be sideways if the device is held in a landscape manner)?
You don't need to have a landscape default image even if you do support landscape.
If you are only in portrait, then a single image will do.

Resources