What are the recommended size multipliers when trying to create images for iPad (previously iPhone only app)? - ios

I am trying to make my app universal so now I have universal image sets but apparently I need to make separate iPad sets. I have images in my Assets that fit an iPhone the way I want, and I can scale up for 2x and 3x, etc. but when I go to iPad what would be the size comparison for the first (standard) iPad image? I just don't know, relatively which of my iPhone images I should use and how much to increase it by for my starting point on iPads.

Related

Assets.xcassets - Universal not working

I am using Universal for Assets.xcassets in the hopes that I only have to create 3 different sizes for each image I use. But, despite Assets.xcassets telling me that my images are Universal in the Attributes Inspector, when I test on my iPad, the images are blurry and aren't as sharp as they are on my iPhone, making me question why there is a Universal option.
I've double checked all my images and they are all correctly sized.
My questions:
In the Attributes Inspector, under Universal, there are iPhone and iPad options. In order for my iPad to provide crystal clear images, should I use the iPad option?
And if I should: What's the point of the Universal option if it doesn't really do its job?
Also if I should: What size images do I use. The iPad option gives me the options of 1x and 2x size images. So, should the size of the 1x image for iPad be the same size as 1x image for Universal?
Thanks in advance.
Universal merely means that this app will run on iPad and iPhone natively. Thus the devices on which your app might run can have a single-resolution, double-resolution, or triple-resolution screen.
If you have checked Universal, accordingly, you should see three slots:
Your job, therefore, is to make three versions of your image, sized in proportion. If the 1x is 100x100, the 2x should be 200x200 and the 3x should be 300x300. The version in the appropriate slot will be used at runtime in accordance with the screen resolution of the device we're running on.
The asset catalog does not do any image sizing for you. You have to do it beforehand. (I find Graphic Converter a nice utility for this purpose.)
You could just supply a 3x image and allow the runtime to size down for you, but this is a waste of memory; Apple specifically advises against this in one of the WWDC 2016 videos. So just bite the bullet and make all three image sizes yourself.
Finally:
when I test on my iPad, the images are blurry and aren't as sharp as they are on my iPhone
Hmm, the only reason I can think of for this is that your app is not running natively on the iPad, but is an iPhone app running in "emulation mode" on the iPad. If that's the case, nothing you can do is going to make it look really good. It would be better to write your app as a true Universal app. That is a setting that you make when you create the project initially (though it can be changed later by editing the app target).

Why would you use native iphone 6 resolution in xcode when building your app?

As of yesterday I had an app using mostly static sizes to fit an iphone 5 screen (320 points width). It was working fine in iphone 6 as well thanks to the system scaling up automatically.
Then I decided to add a retina hd launch image and everything became a lot smaller on iphone 6. So I decided to modify my whole application to use dynamic sizes and fonts so that it would fit the two iphone types the same way. And now it is working quite good.
But after these few hours of extra work, I keep asking myself the same question... what was the point? Why would you want to use dynamic sizes that fit both iphones when you can make it work for iphone 5 and let the system scale up automatically?
the use is: more screen estate. You can fit more on the screen.. at the least images or maps could be bigger while buttons retain there size -- they normally don't need to be bigger :) same for the keyboard.
you don't just get everything scaled but you can decide what is scaled and what isnt

Images.xcassets in Xcode 6

I am trying to figure out how to use the xcassets folder in Xcode 6 and I have to say Apple could have done a way better job. I'm a big fan of Xcode but their images storage per type of screen / phone is a nightmare.
First, in my application I am using images which will have a height of half their width. From what I understood, taking pictures of around 1200x600px should do for all types of iphones (full width minus small margin). So I put them in 3x universal, right? If I gave the maximum size why would apple need 1x and 2x ...? Just resize it yourself, no? Is it compulsory for me to give something or will it work by itself? Images are not vector but simple PNGs. In the simulator nothing is complaining and it works well for all types of iphones. Is it okay to leave the other two empty? From I see from the simulator iphone 6 will use downsized #3x images so what is the point of having two images? Only ratio is important and they have the same ...
Secondly, I just added today a launch screen for retina hd 5.5 / 4.7 and now when I run the app in the simulator my uitableviews only take around 4/5 of the full width instead of full width .... can't figure out why adding a launch screen would modify layout of my uitableviews ....? Navigation bar and other screens seem untouched though ...
Any help appreciated.
you need to add the images for the 2x & 3x because when you add large size image then at the run time this image get resize as per the actual width of the image it utilize memory lots of memory to do this & some time if your application have too many images then you will get memory issues
if you want to test this then run your application in iPhone 5 then see the memory utilisation by first keeping the high resolution image now take image which will be of appropriate size to iPhone 5 & then run again you will see the difference
so the best practice is to use different image for different size & not images in this fashion.
The answer to your second Question
if you are not adding the splash screen for iPhone 6/6+ then iOS stretches your UI of iphone 5 to fit into the size of the iPhone 6/6+.
But when you add splash screen it stops doing that.
late to the party but yes you need to manage all this resolution by yourself. Otherwise it will consume more memory.
but yes there is one tool which will make your work less by generating all assets for you
AVXCassets Generator

Using less Images for non-retina, retina and retina HD (#1x, #2x, #3x) for Universal Apps

To support iOS 7 to 8 on universal devices, I have to make 4 copies of the same image in different size.
For the iPhones
image#2x.png (iphone 4s,5,5s,6)
image#3x.png (iphone 6+)
For the iPads
image.png (ipad 2, ipad mini 1)
image#2x.png (ipad 3, 4, ipad mini 2, ipad Air)
The images are really bloating the app size.
Is it ok to just use 1 image size, the largest one of the set and scale to fit in the uiimageview and use the image view to scale down the image on the smaller screens?
imageView.contentMode = UIViewContentModeScaleAspectFit;
or is it absolutely necessary to have all 4 copies at different sizes?
It works on all the devices on the simulator and on a retina iPad 3, but I have no way of actual testing on other devices and am afraid that the images may not display.
Has anyone tried using 1 large image instead of the set of copies?
Yes, you can theoretically use the largest resolution image and have the UIImageView scale the image down using mode Aspect Fit.
The only drawback is the older phones that don't support retina also are less performant. For example, when using images on cells of a UITableView and scrolling, the device has to load the large image, then scale the image down, and scroll it at the same time, and it will stutter on old, slower devices.
So, perhaps just use multiple images in list views (should just be thumbnails and are tiny anyway, or just use the smaller images here), but don't worry about larger images that stay on the screen and don't scroll.
Make sure you load images in list views using methods that allow caching like imageNamed:.
As long as you take into consideration the performance penalties involved in scaling down the images, you can use just the largest image and scale it down to fit.
By the way, yes I've used this technique in real live apps in the App Store.
Another technique I've seen is to include lower quality images (1x or 2x) and if you run it on a higher resolution device (2x or 3x), automatically download high resolution images from the web. Maybe be nice about it and only download them on wifi.

What resolution do I need to make images for universal iOS apps in?

I am making a Universal app on xCode 4.4, using Storyboards. I am making the images for this app in Photoshop. I want to make a background image that fills the whole screen.
What I want to know is:
What resolution do I make the images?
Do I need 1 for iPad and 1 for iPhone, or more?
How do you make it work with the iPhone 5 as well?
You might need up to 10 background images:
There's the retina iPad: 2048x1536, non retina iPad and iPad Mini: 1024x768, retina iPhone: 640x960, non-retina iPhone: 320x480 and the new iPhone 5 (retina only): 640x1136.
That's 5. If you want to support both landscape and portrait, then you have 10 combinations.
PS: If you decide to keep the status bar visible (as most apps do), then reduce the height with 20 pixels (40 pixels for retina displays). That's how much room is needed for the status bar.
You should consider the approach of using only one image. The user experience of most apps is poor if you dont respect the available canvas size.
And you might want to focus special areas of your artwork to the user.
I would propose you to implement different scenarios at least for iPad and iPhone.
The resolution itself is described within the specs. So use one for iPhone and one for iPad, the different logos are posted in two resolution, with a postfix #2x or for the new Appstore dimensions with another prefix, but all these details are within the specs.
My experience is that in most cases you have to organise the user interface separately in order to provide a good user experience.

Resources