Launch screen image not displaying correctly - ios

Working with the iOS launch screen and it's a very painful experience.
Finally got it to appear, but no matter what I do it won't align properly. It's either stretched too far, or in a weird position off the screen.
What values for mode and stretching should I use to display this image viewer in my .xib?

If you're using the Launch Screen.xib or Launch Screen.storyboard, you need to set the correct AutoLayout constraint in your IB file.
If you're not, you need to set the Launch Images Source in your project general settings page.

Related

Abandon image cassetts for LaunchScreen.storyboard

So I have a fairly old app, last time worked on before iPhone X(s) was released. Always used Launch Images Source instead of Launch Screen File as seen below.
I am now having issues launching on iPhone X, as the screen size is assumed from the LaunchImage and there is NO launch image currently provided for iPhone X(s) in the "LaunchImage" file of .xcassets folder.
What is the most straightforward way to abandon using cassets in use of the new "Launch Screen File"? I have already tried creating this and using it, but had no luck getting an UIImageView to resize an image with said screen sizes on devices.
Im really looking for a straightforward guide for creating a LaunchImage.storyboard file that can adapt a launch screen image(full-sized image) to any device size.
What is the most straightforward way to abandon using cassets in use of the new "Launch Screen File"?
Change the Launch Images Source pop-up menu to "Don't use asset catalogs".
Make a LaunchScreen.storyboard if there isn't one, and point Launch Screen File at it. Make sure your launch image storyboard uses autolayout and is designated as a launch screen.
Now configure your storyboard's view controller using autolayout so that it lays out correctly on all devices.

Xamarin Forms iOS Launch Screen Image Position

I am using Xamarin Studio and have a Xamarin Forms project for both iOS and Android. For my iOS app, I have created a xib file for my launch screen. I have added an image view and and an image to that view. Every time I change the simulated metrics size (in Xcode) the image repositions itself (same if I run on different sized iDevices). How do I correct this? I want the image always centered vertically and about 1/3 of the way down from the top. Thanks
As mentioned on the Xamarin Launch Screen Guide, if you use a Universal Launch Screen and click Enable Size Classes, then your Launch Screen will automatically scale dependent on the screen size.
I also personally found, that I needed to use Center Constraints for my ´Views` as described here. As mentioned in the guide:
If you choose a horizontal drop area, the constraint will be based on
centerX
Hope this helps.
Edit
You may need to open the .xib file in XCode as there is an issue opening Universal Screens in in Xamarin Studio.
Additionally, to enable Size classes in XCode, simply follow this guide.

How do you Implement Landscape Launch Screen for iPhones?

How do you implement landscape launch screens for iPhones? I've seen the "plist duplicate" posts and added the arrays they suggested to my plist, and added my launch images to my xcassets file which is set as my launch image so it shows as just a black screen. when removing assets catalogue, theres a bar of black on both the left and right side of the screen the whole time the app is running. Also, if its not done through cassettes, what do you name the images and where do they go? Thanks!
Are you asking about launch images or launch screens?
There's no such thing as a landscape launch image for iPhone. You provide a normal launch image in portrait, and if the app launches in landscape, that launch image is automatically turned on its side.
But in this day and age it would be best to forget about launch images and use a launch screen, a xib file or storyboard. It knows nothing of orientation and doesn't need to know anything: you just configure its appearance using autolayout to match whatever the circumstances turn out to be.

Using a launch screen (.xib) stops scaling

It's my understanding that apps for iOS 8 should have a storyboard file as launch screen rather than an image. I've created a really simple launch screen file that has any width and any height, and has one label of plain text reading "placeholder" and set it as my launch screen. However, when I try to run my app on the iPhone 6 and 6 Plus simulators, there's black bars around the background and the buttons on the main menu are out of place. The problem doesn't seem to be present in the 5s or iPad. Most of my assets aren't optimized for the 6 and 6 Plus though, since they were created before they came out. Is that why this is happening? Or is it something else? Thanks in advance.
Edit: Apparently, putting in a launch screen stops the app from automatically scaling. Is there a way to have both a launch screen, and keep the app scaling? Or do I need to make new assets?
This is a bit of an old question, and I ended up using a launch image instead of a launch screen, but you can probably solve this by using constraints. If you set top, bottom, leading, and/or trailing constraints on an item in the view, it'll scale itself to fit those constraints (if possible). For text, it has the autoshrink property which you can change to minimum font scale (instead of fixed font size), though I'm not sure how you can scale text up. The autolayout documentation is here.
To create a launch screen from a xib file first create a new file from under “User Interface” and select the option called “Launch Screen”
Using autolayout, design the first view of you app so it scales to suit all resolutions that your app supports.
Using the new Launch Screen
Under the app setting select the newly created Launch Screen from the app options.
This is the example for using a xib file. It can also be done using storyboard as shown in Ole Begemann blog

Random launch screen on iOS apps [duplicate]

I have a sponsor logo on the launch image. Is there a way to dynamically change the launch image to rotate sponsor logos?
Thanks
The default image for an iphone app must be a fixed image file in your bundle. You cannot change it dynamically.
However, you can have a dynamic image that appears when the app loads after the launch image. You can set that up with animations or simply to select a random image each time.
According to Apple's HIG, Human Interface Guide, the splash screen is supposed to be used only as a placeholder to give the user the illusion the app is open while it completes it's startup process.
Apple will allow some use of the startup screen, but know they can and do have the right to reject your app solely on how you use it.
Like the previous answer stated, you could do anything you want after the initial startup screen has passed. Play a video, run an animation, or display a second view with your sponsored images.
And finally, I don't recommend doing this, but if you are determined to work something into the startup screen, you could try this.
The splash screen is hardcoded or set to 1 filename. Before your app closes, you could dynamically replace the hardcoded filename with a new file from a webservice or local storage, replacing the existing splash screen image. I haven't tried this, but it is more than likely possible. Just beware that it may not pass muster with Apple's approval process. Good luck.
As i needed different images on iPhone & iPad Splash screens, i followed below steps:
1. Add two UIImageViews
2. Set Width & Height constants for both UIImageViews as per your requirements.
3. Now select the iPhone UIImageView and set its Height Constraints Regular Regular (RR) height constant as 0.
4. Do the same for for iPad UIImageView and set its Height Regular Regular (RR) height constant as actual required height and set 0 to the Constant.
5. When you test it on iPhone the iPad ImageView will disappear and vice-versa will happen on iPad.

Resources