One splash screen for all display sizes - ios

So, the question:
Is there any way to use a simple .xib or something like it, to have a splash screen with just a solid background extending the full width and height of the screen with a single, centered image?
I'm just learning iOS development and Objective-C.
I'm trying to find a simpler way of creating a splash screen for an app without using the traditional loading images.
Why?
In android development, I can use a fragment as a splash screen and place a single image at the center on a colored background. This will scale for ANY screen size, in ANY orientation.
In iOS development, they want me to create multiple image files for every orientation and screen size. This is not very scalable. If the logo or design changes, every one of these files has to be recreated and added again to the app.

You need to understand that the launch image Apple requires you to include is not for the purpose of being a splash screen. It is there to make the transition from the launchpad into the splash screen smooth. Yeah, it doesn't scale well, but it's just one image - you can handle it.
I don't know how to do it using auto layouts, but the old school way would be to place a UIImageView in the centre of the view set its autoresizingMask property to UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight. In Interface Builder it would look like this:

Related

iOS how to expand Image View to borders in Launch Screen?

I am 2 days into iOS app development, I am quite new. The very first thing I wanted to implement in my app is a Launch Screen using Storyboards (I heard there are other ways but I found this the easier). I have a vector-based PDF file (image) because I wanted to implement a gradient background without a loss in quality that supports all device resolutions.
I created an Image View in the Interface-Builder (IB) but it does not automatically stretch vertically and horizontally to fill the device length.
I simulate my results on an iPhone 14, only thin white margins appear, but on a large iPad, the majority of the screen is white. It's like as if the the image resolution is fixed across all devices.
No matter what resizing I try, I can't get it to work.
I come from an Android app development background so something like this is very easy to implement (we have fill_parent / match_parent to stress the view to its containing parent view dimensions). Is such a behavior possible on iOS ?
You have to apply constraint on the image in launch screen.

Launch screen image not displaying correctly

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.

Adaptive Layout 3.5 inch iPhone

I'm really new to the adaptive layout scene. I'm working on a project that I want to look really great on all iPhone screen sizes.
The question I have is: Is it possible to place a text box in a specific spot on each screen? The specific situation is that I have an image that takes up a majority of the screen. And I want to place an input box on top of that. Here is a screenshot to give you an idea of what I'm talking about.
And here is a screenshot to kind of show you how I have the background image set up.
The background image is placed perfectly and looks good on all screen sizes.
Do I need to place the textbox specifically for each screen size using size classes?

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