Launch screen custom image for iPad - ios

I need to present different image on the launch screen for iPad.
Our designer provided only 2 images:
one for iPhone portrait
one for iPad landscape
So I cannot use Launch images and assets catalog
Instead of that I'm trying to use LaunchScreen.xib,
I'm trying to name them like it is described here https://developer.apple.com/library/ios/documentation/Cocoa/Conceptual/LoadingResources/Introduction/Introduction.html
with ~ipad and ~iphone postfixes
But I didn't manage to figure out how I should place them in the assets catalog
How can I present different images for iPad and iPhone

I found out that it could be done with right click on the detail asset view in xCode

Try to open assets catalog in xcode and choose LaunchImage.
Next right click and select New Launch Image.
After that you will have new asset. image here.
Put you images there.
Next step is delete old LaunchImage asset and rename new.

Related

For iOS LaunchImage, do I need all images?

If using launch image asset do I need to specify all the images if my app is only in portrait mode and only for iPhone? I.e. do I need the landscape images or the iPad images or will it work without them?
If your app is only in portrait mode and only for iPhone, then no you don't.
I would suggest using Storyboards instead of launch images. Here is how you could do so:
This is how:
Create a blank storyboard file named for example MyLaunchScreen.storyboard.
Click on your project and go to your Target Settings and, on the General tab, select the storyboard as your Launch Screen File. Xcode will then add a corresponding UILaunchStoryboardName key to your app’s Info.plist. When this key is present, Xcode will prioritize it over any launch images you might have set.
Add a view controller scene to the storyboard, add UIImageViews or whatever you like. Adding some constraints will make this storyboard work on all devices without having to set images for all devices.
If you still do want to use images, here is how:
a. Click on the project target, in the General tab, set the Launch images source to be an image asset
b. In the launchImage image set, toggle the attributes inspector and set the device classes that you'd like to add launch images for. In your case just the iPhone portrait checkbox should be selected:
You can specify which images you'll add, it should reflect the project settings device support. So no, you don't all the images. And be careful with the retina and retina HD support, your layout could be down-scaled.

Add Launch Screen Image instead of using LaunchScreens.storyboard for iOS

I'm doing my UI for my iOS apps programmatically. The only things that is left is the LaunchScreen.storyboard where I didn't find a way around using it, yet.
Strangely I can't find much about that in the internet.
Is there a way to get rid of it and use an AssetSet instead?
That's (the highlighted file) what I want to get rid of
Since the question included "use a View or and UIImage instead?"
From Apple's docs...
Static Launch Screen Images
It’s best to use an Xcode storyboard for your launch screen, but you can provide a set of static images if necessary.
Reference page, including a list of required image sizes: https://developer.apple.com/design/human-interface-guidelines/ios/icons-and-images/launch-screen/
Note: To use images instead of a storyboard...
In Xcode open your Assets catalog (or create a new one), right-click in the assets section and select App Icons & Launch Images -> New iOS Launch Image and it will create the proper template. Also go to project General settings and select Launch Images Source - Use Asset Catalog...
There is noway to accomplish what you want , you have to supply a storyboard file for the launch screen in plist , if you want to customize go to the layout and add image or anything you want , there is no place to configure a programmatically UIView for that
Here a short description of the steps based on the answer from https://stackoverflow.com/users/6257435/donmag:
create a new AssetSet: + -> AppIcons & Launch Images -> New iOS Launch Image
Go to your Target Settings to General
Under App Icons and Launch Images clear the field Launch Screen File and select your LaunchScreen Asset set that you just created at Launch Images Source
You might have to delete the App from the device/simulator that you test it on and the new Launch Image should show up on start

iOS Launchscreen is not being displayed in Xamarin.Forms

I don't know what happened but since some days ago the LaunchScreen is not being displayed. Check the following:
Any ideas?
Seems that you want to use LaunchImage Assets for your LaunchScreen. You are setting Source & LaunchScreen, both, at the same time.
If you want to use LaunchImage Assets, Delete the content inside the Launch Screen in info.plist as below:
Launch Screen uses the LaunchScreen.storyboard single file to use across the devices (iPhone/iPads).
While Assets Source uses the Image catalogs, to set specific Launch Image for some specific device of resolution.
You have to use both of this options as an alternatives.

How to display launch image

I'm a very new to iOS.
My Xcode version is 7.2.1 and I'm trying to run on iOS9 using Swift.
My problem is that I'm very confused with how I should be creating the Launch Screen Image.
I found that there are many ways of creating the launch screen images for different version of iOS.
Can someone please explain to me how to setup my launch images?
The process I've followed is:
I create Launch Screen.storyboard I create different sizes of
launch screen images in Photoshop.
In General tab, Choose Main Interface "Main".
In App icons and launch images> Launch images source "Brand Assets".
I click on the arrow beside of Brand Assets, and then I put different sizes of images. (iPhone- iOS 8,9 , iPad- iOs 7-9 (Portrait and landscape), iPhone portrait).
Launch Screen File is "empty". I didn't choose anything.
After all I run on iPhone 5 simulator. It did not show anything and just black screen appear.
One thing I want to know is that do I need to put a UIImageView in my Launchscreen.storyboard?
Isn't it automatically retrieved from the Images.xcassets folder?
you can set Launch Screen like this
step 1: Go to Target -> App icon and luanch images
step 2:
step 3: LaunchScreen.storyboard
When you start a new project, you get LaunchScreen.storyboard below are the steps you should follow:
Put Image View in the viewcontroller present in the LaunchScreen.storyboard
Use autolayout to adjust the image view as per your need.
Select the imageview, go to attribute inspector and change the image.
Hit run

Launch images not showing with Xcode 7

I have set the launch images in an asset catalog (LaunchImage), which I've also set in the target's "General" tab in Xcode. The default LaunchScreen file was being shown when running the app, but I read this post and I did what it is said there: to left empty the Launch Screen File parameter both in "General" tab and in .plist
But now, instead of showing the appropiate launch image from catalog or the default one, I'm showing a black screen...
I'm supporting only iPhone, and iOS 7, 8 & 9.
What could I be missing?
Thanks
EDIT: could this be because of incorrect image sizes? For example, for the iPhone Portrait Retina HD 5.5 I have a file of size 1242 x 2208 and name launch_iPhone6Plus-Portrait#3x.png, is that correct?
EDIT 2: This is what I have in the target's "General" tab.
Well what I've noticed that when you create a new project by default you will get LaunchScreen.storyboard as you Launch Screen Image.
But if you don't want to use LaunchScreen.storyboard then what you do is remove LaunchScreen.storyboard and tap on Use Asset Catalog.
But by default it will give you Brand Asset instead of Launch Image in Xcode Version 7.1.1.
Now click on the arrow besides Brand Asses/Launch Image. Xcode will navigate you to Assets.xcasets folder.
Now click on + below to add App Icons & Launch Images.
From there you need to select New iOS Launch Image.
This is how your LaunchImage should be visible.
Now add the images according to size specified in the Apple Documentation. You can also get Launch Image Size from this url: LaunchImageSize
Now go application>Targets>General and in Launch Images Source select LaunchImage.
Here is the image with LaunchImage added in Assets.xcassets.
Simulator Image on launching App.
Hope it helps in solving your problem.
Have you changed the setting for your project so that it points to the Asset Catalog as the source for your Launch Image?

Resources