I have had a look online and at other questions but I cannot seem to solve my simple but annoying problem.
I am using assets.xcassets with a variety of different sized launch images. If I tick "Portrait" in my development info in my Xcode project game, the launch image shows perfectly.
However, my game is played in landscape mode! But when I untick "Portrait" mode, all I get is a black screen for the launch image!
I understand that Xcode cannot launch images in landscape mode. But is there any code I can use so that I can launch my launch screen in landscape mode?
Thanks :D
I may recommend a tricky way, just design a landscape launch screen but put vertically for portrait mode, so it will work like landscape launch image, but actually it shows in portrait mode, then work for your all other views in landscape.
and in app delegate add this one:
func application(application: UIApplication, supportedInterfaceOrientationsForWindow window: UIWindow?) -> UIInterfaceOrientationMask {
var orientation: UIInterfaceOrientationMask!
orientation = [UIInterfaceOrientationMask.Landscape]
return orientation
}
Related
My game uses a fixed portrait orientation. I have personally tested on a couple phones and a tablet. I have never seen issues with my code; the game always has a fixed, forced portrait render.
However, all of the screenshots generated in the Google Play pre-launch report show the game rendering in a landscape orientation.
Searches suggest that, by default, the report should have been running in portrait anyways.
https://support.google.com/googleplay/android-developer/answer/9842757?hl=en
Can test devices run tests on apps that use landscape configuration?
The test devices are predefined to run tests on fixed portrait page
orientation by default. However if your app is locked to landscape,
you should see videos and screenshots in landscape mode.
Any info is greatly appreciated.
Thanks
Turns out I did not properly setup my app for portrait only orientations.
I had found a post suggesting the following code was enough to make things work:
Screen.autorotateToLandscapeLeft = false;
Screen.autorotateToLandscapeRight = false;
Screen.autorotateToPortraitUpsideDown = true;
Screen.autorotateToPortrait = true;
However, I also had to change a setting in the Unity Editor itself
Project Settings -> Player -> Resolution and Presentation -> Default Orientation -> Portrait
Adding that fixed everything
Windows 10, Visual Studio 2019 (16.5.4).
I've been following this example:
https://learn.microsoft.com/en-us/xamarin/ios/app-fundamentals/images-icons/launch-screens?tabs=windows
Which is fairly straightforward. My splash screen is simply a blue background with my logo in the centre. However, I cannot work out how to centralise the logo on every iOS device and both portrait and landscape.
Do I have to create a different Asset or LaunchScreen.storyboard for every device?
The way I am familiar with that you can create a responsive design in iOS is to use the concept of AutoLayout.
But before you start that you should be aware of the basics of designing in iOS
Goodluck
Feel free to get back if you have queries
I cannot work out how to centralise the logo on every iOS device and both portrait and landscape.
In the designer you can grab the dot in the centre of the view and then drag it to the vertical or horizontal lines:
Check https://learn.microsoft.com/en-us/xamarin/ios/user-interface/designer/designer-auto-layout#center-constraints
I am using the Preview Mode in Interface builder in Xcode 10 and cannot see how to rotate from portrait to landscape.
In previous versions you just moved the mouse pointer over the preview outline and got a rotation button. This isn't happening for me.
It is impossible to see in dark mode, but click right where the arrow is and you will be good to go.
If neither (left or right) of the iPad landscape device orientations are supported, does the landscape launch image ever get shown?
I am currently working on a portrait orientation only app. I have not found a way to launch the app with the landscape launch image shown. So, i don't think that the landscape image will ever been shown. Still you should include it in your app bundle to pass the App Store approval process.
Thank you for reading this.
I created a brand new project in Xcode 4 (Window based kind) and tried to get the splash screens working.
If I click on the blue icon of my project (top of the project hierarchy) and then click on "Target/Project", I see that I can drag and drop two launch images to use them as splash screens.
My portrait picture is a 768 x 1004 px png file and my landscape picture is a 1024 x 748 png file.
When I drop the portrait picture, everything looks fine but when I do the same with the landscape picture, I have a big yellow exclamation point that appears.
If I hover my mouse pointer long enough on the exclamation point, it says:"
the size of the launch image for iPad in landscape mode does not match
the recommended size of 1024 x 748 pixels
".
Just to be sure, I verified in Photoshop and a mac buit-in application and both do say my image is a png file of 1024 x 748.
I tried another picture and got the same message. I created a new Xcode project and also got the same message.
When I build and run the minimalistic project in the iPad simulator, I get the portrait splash vertically in Portrait orientation (ok) and the portrait splash horizontally in Landscape mode (not ok).
What can I do?
Just for you to know:
When I go to the Project-Info.plist, I do see "Supported Interface Orientations (iPad)" and it has 4 items:
Portrait (Bottom home button)
Portrait (top home button)
Landscape (left home button)
Landscape (right home button)
I also copied manually the 5 following files at the root of the project but it didn't help
Default-Landscape~ipad.png
Default-Portrait~ipad.png
Default-LandscapeLeft~ipad.png
Default-LandscapeRight~ipad.png
Default-PortraitUpsideDown~ipad.png
Whatever I do, it just recognizes the portrait picture and uses them for each orientation...
At this point, my project is very minimal and is just made of an appDelegate "h" and "m" file and a "mainWindow.xib" file, that's it (I didn't edit any of them yet).
Any clue?
Thank you.
Edit: try making the image 748x1024 instead of 1024x748 as suggested here.
From SO question - iPad Launch image landscape:
If you're on Xcode 4.0.2+ then the landscape iPad launch image needs
to be 748 * 1024. This is how it works in one of my apps.
Also, Upgrading to xcode 4.1 will fix the big yellow warning you get even when an image is the correct size.
The warning is also different based on your plist setting for "Status Bar is initially hidden" or not. If it's hidden, then it needs to be 1024x768, it not hidden then 1024x748... etc.