Launch Screen image - universal pixel sizes? - ios

I'm having trouble setting my launch screen image (not a image that fills the entire page i.e., not a splash screen) that works on all the iOS products (iPhone, iPad to name some).
I would like to know the universal pixel or point sizes for each set - 1x, 2x, 3x. As far as my google search goes, assets catalog creator seems to be the solution. But are there any alternates?

Related

Adapting Launch Screen storyboard to launch images with fixed sizes

I have an application for medical calculations and analysis that utilizes dozens of screens for data entry, each with carefully spaced entry and display fields. The app has two versions of each input screen, one for pre-iPhone X screen dimension (640x1136 ratio), and one for iPhone X screen dimension (1125x2436 ratio). In the LaunchImage section of the current Assets.xcassets scheme for launch screen images, I have a black png image that is 640x1136 pixels entered into the Retina 4, Retina HD 5.5", and Retina HD 4.7" slots, and a 1125x2436 pixel image image entered into the iPhone X / iPhone Xs slot. By placing images in this way, the OS automatically preserves the needed screen layouts, regardless of the size of the iPhone screen, even though I have a compiler warning that two of the launch screen images are the wrong size.
With the upcoming requirement to use a launch screen storyboard, I am unable to find, after extensive research, any way to preserve the crucial functionality that I have had to date, using the size of the launch screen image to enforce formatting dimensions. I understand the intent of the launch screen storyboard to simplify support for multiple devices with different screen shapes and sizes, but in my particular case, the new requirement introduces a very significant problem. Am I missing something, or is there a way to use the new launch screen storyboard in the manner that I have been using launch images?

what size should I choose to show fullscreen images in different 1x,2x,3x iPads

I am working on designing a universal (iPhone, iPad) application, this app is portrait only, and I want the application show some fullscreen images to users.
I edited my images size for (iPhone) like this in 1x=> 320*480px and 2x=> 750*1334px and for 3x=>1125*2436px.
now I am designing the app for different iPads. I searched a lot to find whats the best sizes for 1x and 2x and maybe 3x iPads but I couldn't find any exact pixels which I should choose for my images. its very important for me to show images with high quality and no and no stretch.
my question is what sizes in pixel should I choose for my images to shown in iPads perfectly.(full screen and portrait).
Appreciate any help.

full screen image sizes and naming in xcode

I'm a bit confused here. If, say, I want to set an image as background (full screen) for my ios app (iphone), what are the sizes for the image I have to make? I googled and found no clear answer yet.
Using image assets gives no explanation either. I tried creating new image set, it just shows 3 slots for 1x, 2x, and 3x. How the xcode differentiate between what image to use for iphone 5 and iphone 6 (different ratio)?
EDIT
I seem to be unclear about my question. If the image for iphone 5 and 6 is the same, doesn't the aspect ratio differ? It will be stretched on one device or vice versa on the other and I don't want that. Back before the iphone 6, I just create image .png, #2x.png, and -568h#2x.png with the size 320x480, 640x960, and 640×1136. So my question is, for iphone 6 and 6+, what is the naming and size for my images?
If, say, I want to set an image as background (full screen) for my ios app (iphone), what are the sizes for the image I have to make?
You can use [UIScreen mainScreen].bounds's width & height to setup your view frame.
it just shows 3 slots for 1x, 2x, and 3x
They're not used for handling ratio of displaying, just for display solution (retina or not). You can just use xxx.png in your code, and it'll choose to use xxx#2x.png or xxx#3x.png appropriately.
How the xcode differentiate between what image to use for iphone 5 and iphone 6 (different ratio)?
UIImageView has an instance method called -setContentMode:, you can use UIViewContentModeScaleAspectFill mode for displaying in different devices w/ different ratio, i.e., some parts will be cut off.
This link should give you an overview of the differences between the 1x, 2x and the 3x image assets which we get once we create a new image asset.
http://9to5mac.com/2014/08/29/support-for-3x-image-assets-found-in-latest-ios-8-beta-ahead-of-larger-display-iphone-6/
Also when you create a new image asset, you can select image for specific devices such as (iPhone and iPad), if you are only developing for certain devices.
Select the devices as "Device Specific" from the Image Set Shown on the right side of the image.
As for you question, iPhone 5 and iPhone 6, xcode will take the same image assets i.e. 2x, for iPhone 6 Plus it takes the 3x image.
App Icon and Launch Image
Now for the App icon and the Launch image, this following link will guide you through.
http://www.iphonelife.com/blog/31369/unleash-your-inner-app-developer-managing-images-xcode-5-asset-catalogs
https://developer.apple.com/library/ios/documentation/UserExperience/Conceptual/MobileHIG/IconMatrix.html
for the launch image there are different options available, such as you can individually set images for the landscape and portrait images for different devices.

Xcode 6.x Story board button size issues

We have added image sets to the xcassets folder. They are all named properly. When we set up a button with constraints the box for the image scales, but the image itself stays the same size on all phones... how do you set it up to keep the button image scaling to the relative size so the proportion stays the same on all screen sizes and the 1x 2x 3x images are utilized.
See screen shot here (sorry still dont have enough points to post photos so here are links)
https://www.evernote.com/l/AHGB5KrFQCtHtJAV1u5AP1eG_G1KpeMznXg
this has the proper 1x, 2x, and 3x images
Here is what it looks like in preview for the various phone sizes, notice the buttons (images of male and female do not scale).
Xcode Preview option
https://www.evernote.com/l/AHGq50vKq3tG151kfmUG4mjK0Iz6yYeg_Ck
So not 100% sure what the issue is or if this is just an issue with buttons and xcode not properly scaling based upon the 1x,2, and 3x..
any thoughts?

Setting the correct full-screen image as my launch screen xib

We want to support iOS 6 through iOS 8. By my count, that means we need to create ten launch images.
portrait 2x3: 320x480 640x480
portrait 9x16: 640x1136 750x1334 1242x2208
portrait 3x4: 768x1024 1536x2048
landscape 16x9: 2208x1242
landscape 4x3: 1024x768 2048x1536
What I wish is that I could just generate the largest sized image at each ratio, and that iOS would just downsample the image for the other sizes. That would save me from adding five more launch images to my app, a nice savings in download size.
Is it possible to use the new feature of Xcode 6 to replace my launch images with storyboards (aka UILaunchStoryboardName) to do what I want?
It seems pretty close, but I can't figure out how to say, "At 2x3, use image X; at 9x16, use image Y; at 3x4, use image Z" and so on. Size classes don't seem to let me express that concept cleanly. (Or do they?)
Here is one way to do this... Create a new image set in your existing or some new assets catalog. By default, the Devices field of the new image set, in the right pane, will be set to Universal, and so you should see three image wells in the main view: 1x, 2x, and 3x. What you want is to set the Devices field to Device Specific, then check iPhone, Retina 4-inch, and iPad underneath that field. Then, you will now see six images wells. There are four for iPhone: 1x, 2x, Retina 4 2x, and 3x. There are two for iPad: 1x, and 2x. Now, all you have to do is to drag your versions of the same splash image in various device-specific sizes, into the appropriate image wells. Once you are done, go to your launch screen XIB, which by default is set to Any width and Any height, and add a UIImageView, setting the image to have the same name as the image set you just created. Adjust the image to have the same size as the enclosing view, adding top, leading, bottom, and trailing constraints with a constant value of 0, so that the image size adjusts with the view size, regardless of the device. Run the app on your device and you should see the correct splash upon launch. You can set a breakpoint at the top of your AppDelegate code, e.g. right underneath the var window: UIWindow? declaration (or equivalent if using Objective C), so you can verify the splash on different kinds of device. Note that the image may not work in the Simulator, so try on a device. I guess that it is a bug in the Simulator, or unimplemented feature.
One thing I am not sure about is where to specify the image for iPhone 6. It seems that there are device specific image wells only for iPhone pre-4s, iPhone 4s, iPhone 5, iPhone 6 Plus, iPad, and iPad Retina sizes.

Resources