How to create full width image splash screen for react native ios app in xcode - ios

My application require a splash screen with a round logo in the middle , the background has some design overlays, So I need the splash screen as a full screen image. I have referred to several post but could not find out how to create the splash screen to fit different screen resolution.
I have created 3 images as Default.png (414 x 736) Default#2x.png (1080 x 1920) and Default#3x.png (2048 x 2732) And I have used LaunchScreen.xib for implementing my splash screen with an outer UIView and an inner UIImageView with an intention for holding the Default.png image as full screen. In emulator, some of the devices shows blank spaces horizontally and in tab vertically.
I think I need to add more images for different resolutions. Can somebody help me to get rid of this issue of adding full screen splash image

Related

White area on top and bottom of iphone x when using launch image

EDIT:
This question is NOT a duplicate of this: How to Add iPhoneX Launch Image
I have gone through the question there and all answers, and they do NOT address my issue!
I'm using launch images (not launch screen) for an iOS app, and have added a 1125 x 2436 pixel launch image for iPhone X. Problem is, when the app runs, the launch image isn't completely full screen, and the top and bottom white area is still visible. How can I make the launch image fully full screen ?

Launch Screen Storyboard

As LaunchScreen I want to have an exact image of the start page that appears right after the launch.
Therefore, I made screenshots of all resolutions of the start page, both portrait and landscape. Then I removed all fonts because I generate two variants of the app in different languages and the texts (e.g. in the buttons) are different. The launch screens should fit both variants.
In Images.xcassets I added LaunchImage and assigned all positions with the correct resolutions (for both, iPhone and iPad).
LaunchScreen.storyboard has an ImageView in the ViewController with the image name LaunchImage.
Result:
1 All launch images displayed are scaled even though the correct resolutions are available.
Only the portrait images are used, also for landscape, and therefore scaled and distorted.
on iPads only iPhone images are displayed, portrait version also in landscape, scaled accordingly.
On some devices (e.g. iPhone X), only a white or black screen is displayed at launch (portrait and landscape).
Under no circumstances will the correct launch screen be displayed.
On the image you see all relevant areas and the list of all used launch images.
What did I do wrong or miss?
Supplement:
I just followed another tip and deactivated "Clears Graphic Context" in UIImageView and changed the display to "Aspect Fit".
Result: The portrait launch image is still used in the iPad, but is no longer scaled and is now centered.
So the most important question now is why an iPhone portrait launch image is used for iPad in both directions.
If you are using a LaunchImage, you should set that image in the Target settings. Go to your target and under the General tab, set the Launch Images Source value to the image you have in your asset catalog:
Also delete the text LaunchScreen in the Launch Screen File field.

My exported sketch images won't work on different screen sizes in Xcode

I designed an interface in sketch for an iOS app that I am creating and then exported the artboard as a pdf and placed it in Assets.xcassets in Xcode. I am now trying to make that image show up on the entire screen for all screen sizes. When I created the image in sketch, I used an iPhone 6 screen size (375 by 667). In Xcode now, the image takes up the whole screen on a iPhone 6 screen, but it doesn't take up the whole screen on any other device. It is too large for an iPhone 5 screen, so only part of the image is shown, and it is too small for an iPhone 6+ screen so there is white space on the screen. How do I make Xcode scale this image for all the different screen sizes? Thanks
1) First off make sure you're actually saving the asset as a vector:
It'll say Universal under and on the very right you'll notice it says Scale Factors: Single Vector
Now if You're still having issues it probably just means you haven't added constraints to the image. So it's just using the default size (the size you exported in).
If you're using storyboard or XIB make sure the image takes up the space it wants, click on it, then press on the little triangle on the bottom right of the storyboard and under Selected Views press on 'Reset to Suggested Constraints'
This should make sure the image resizes with different views. But because you might get different dimensions you'll probably want to set the UIIImageView's mode. Again on storyboard you can click on the imageView and then:
If you want the image to keep its aspect (not stretch in any direction) but want it to fill the entire space it has, put the mode on Aspect Fill

Launch Screen .XIB with full screen image view

I have created LaunchScreen for my iOS app project which has an image view which is anchored to top, left, bottom and right edges of root view with 0 space.
Q1.What should be the resolution of the image for supporting all screen sizes for iPhone and iPad in landscape or portrait?
Q2.Should I be again providing images of different resolutions for different screen sizes and orientations for iPhone and iPad like LaunchImage asset?
Q1.What should be the resolution of the image for supporting all screen sizes for iPhone and iPad in landscape or portrait?
Regarding to #heximal
You can set "Scale to fill" mode for your image view and provide any image size (size of you xib, for example).
Q2.Should I be again providing images of different resolutions for different screen sizes and orientations for iPhone and iPad like LaunchImage asset?
Create new image set in assets and provide just 3 images for your launch screen -#1x #2x #3x
Refer:
Or visit below link for all image sizes:
https://developer.apple.com/library/ios/documentation/UserExperience/Conceptual/MobileHIG/IconMatrix.html#//apple_ref/doc/uid/TP40006556-CH27-SW2

iOS - App Displaying Scrunched Pre-Retina Version

I have an iOS app that was working fine. Displaying fine, operating fine. When I uninstalled it and gave it a fresh install, about an half an inch on both the top and bottom of the screen is black. It appears to be thinking it's an older iPhone and trying to fit it into a smaller screen. I don't recall changing anything related to this. Any ideas what it might be?
You are testing this in iPhone5 (4 inch size device) than you are finding box layout (black margin top bottom ) hope i am assuming right than
please check your splash image from iPhone5 that is 640x1136 it is not load right now or it would be missing in your application.
add splash screen for 4 size device it will work.
If you are using image-assets for splash screen than add this image in R4

Resources