iPhone 6s and 6s+ font size and image size - ios

Guys I'm facing a issue in 6s & 6s+ device... Can anyone help me with it.. I'm using auto layouts and storyboard
I'm using custom font for the entire app called San Francisco and these fonts looks good with iPhone 5s with perfect size that I'm setting in story board but in 6s and 6s+ some how it's coming in small size !
And even the images are slightly small in size ! I am having 3 sizes like (1x, 2x, 3x) that is also coming small in 6s device ! Let me give you an example like when I use a button with a image ! In story board I have a view controller of size 320 x 568. And I'm setting auto layout in that view controller and when I give image to that button ! That image appears to be small in the 6s & 6s+ device how to resolve it

You should use Assets to set images. And you should add image for all resolution like 1x,2x,3x. For example your image size is 24x24 for 1x then your 2x image should be 48x48 and 3x should be 72x72. your 6+ will use 3x resolution and all other devices will use 2x. If you are not giving support to older ios versions or devices then you can skip 1x image, But if your app support ipads also then you need 1x and 2x.
You can refer Asset Catalog Help - Apple Documentation.
Second thing you can use size classes for different size of your views and your fonts according to different screen sizes.

Related

Appropriate image size for iPad Retina & iPad Non-Retina display

I am developing a Universal Apps. The images are displaying perfectly in iPhone. But their quality is getting decreased in iPad Non-Retina display.
It seems like iPad getting the 1x image every where in the Apps.
I never develope universal apps before, and didn't find any perfect resource out there describing image size for iPad Retina and Non-Retina display. So it would be really appreciable if someone give me any suggestion or resource about the image naming convention and their size for iPad Retina and Non-Retina display.
Example:
For iPhone 4, 5, 6, 6+
image > 44px x 44px
image#2x > 88px x 88px
image#3x > 132px x 132px
What for iPad Non-Retina & Retina display?
Is it? Then what will be the size for 44px x 44px < 1x image?
image~ipad.png (Non-Retina)
image#2x~ipad.png (Retina)
It's depends on your imageview's size. If you are using imageview with same size in iphone and ipad then your same image set should work.
for example if your imageview's size on iphone is 44x44 and same on ipad also then your 1x,2x and 3x should be same for both iphone and ipad as 44x44,88x88, and 132x132 respactively.
but now, you are using larger imageview on iPad says 60x60 then your ipad should required 1x,2x,3x of size 60x60,120x120,180x180 respactively.
You can set universal image set or for iphone and ipad only from assets. you can change it from attribute inspector from assets.
Hope this will help :)
In you assets folder in Xcode, right click anywhere inside the section that contains the 1x 2x 3x images. Under devices you'll see "universal", "iPhone", "iPad", etc. There you can manually drag which images are used for what devices.

Iphone6 and Iphone 6Plus Resolution #x2/#x3

I've a question about resolution of Iphone 6 and Iphone 6 Plus.
I would like to know something about #x2 and #x3, i really need to be sure !
If i've a fullscreen UIImageView, display on a Iphone 6(667x375 points) the size of the containing UIImage have to be 1334x750 because the size in points are 667(#x2)x375(#x2), right?
So if i understand, the UIImageView on Iphone 6Plus in fullscreen is 736x414 but the resolution is #x3 then the UIImage in the UIImageView have to be 2208x1242 because the size in points is 736(#x3)x414(#x3), no ?
Then in a general case, i only need to know what is the size of my UIImageView and if the resolution is #x2 i multiply the size x2 and if the resolution is #x3 multiply the size x3?
Guys i really need a confirmation and if i'm wrong, please, explain me why !
I'm sorry if you think my question is really stupid but i need to understand how it works.
Cordially :)
Lets go for a ride of #1x, #2x and #3x image scaling and content viewer size according to different resolutions in iPhone.
Let understand some basics first
Device Resolution
================================
iPhone 4 & 4S 640×960
iPhone 5, 5C & 5S 640×1136
iPhone 6s 750×1334
iPhone 6P 1242×2208
Resolution reference from this site.
Now if how to use images with #1x, #2x & #3x.
Lets say you have an imageView in with size of 100W x 100H, to display images properly on all the devices with appropriate resolution without stretching or pixelation your image, one need to create 3 set of images as below according to device.
iPad 2, iPad mini supports #1x images, required image of size 100x100(WxH)
iPad, iPad mini supports #2x images, required image of size 200x200(WxH)
iPhone 4S, 5 & 6 supports #2x images, required image of size 200x200(WxH)
iPhone 6P supports #3x images, required image of size 300x300(WxH)
Though your UIImageView size is 100x100 for all the devices, but image displayed in different devices is different according to their resolutions.
Following size Table will give you more clarification, read more about it in apple documentation here
I hope it clears confusion about different resolution images for different devices :)

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.

iPhone5 and iPhone 6 images suffix?

We are trying to make an app for all devices ,designing it on code only.
I could see that the suffix are :
#2x~ipad for ipad retina
#2x for iphone5 and iphone6
#3x for iphone6+
But there is something that i dont get, how is that the files for iPhone5 and 6 have the same suffix and the same name ? these images should be in a different size, and so you cant give them the same name ?
We have created images for iPhone6 with #2x and they seems great on the iPhone6 simulator, but on iPhone5 things dont look good and cover each other .
Cant you separate these files with a different suffix?
I have read this :
Image resolution for new iPhone 6 and 6+, #3x support added?
It is because iphone 5 and iphone 6 (not including the plus) have the same pixel density.
So basically a 40x40 image will look the same on both screens and will take the same space. You will just have to adjust positions to cover for the extra space on the iphone 6 screen.
Images for the iPhone 5 and iPhone 6 are the same size, and the same DPI. So they share the same suffix (#2x). They don't need to be separated.
#3x is for the iPhone 6+ because it has a higher DPI and a larger size than the other phones. Please refer to the Human Interface Guidelines for Images.
You should be using layout to determine how your UI elements are laid out on the screen, and you should be using Auto Layout to make sure they look right on all devices, independent of aspect ratio.
The #2x, #3x image sizes refer to device families grouped by resolution. iPhone 5 and 6 are in the same family, and iOS will use the #2x image for both. The size and placement of the UI element which uses that image, however, has nothing to do with the size of the image itself.

Xcode 6 - xcassets for universal image support

Currently working on a universal SpriteKit project. I'll be supporting the following devices:
iPhone 4/s,
iPhone 5/c/s,
iPhone 6,
iPhone 6+
iPad non-ret,
iPad retina
I am confused on the iPhone part. I already have 4 versions for my background sprite for the 4 different screen resolutions of the iPhones. But which goes to which?
I know the 3x is for the 6+, and I think the 5/c/s goes to the Retina 4 2x, but I do not know where the iPhone4/s, and 6 go. Anyone know?
Side note, when I create a Launch Image inside my xcassets file, I am shown these options, which basically has all the device I am supporting. Just wondering why this is not also the case when creating an Image Set
Also how do you guys approach creating images/sprites for a universal application? Now that the new iPhone 6, and 6 plus are out, I have 2 more resolutions to support which is still confusing for me as I'm still a beginner.
This is a little confusing - here's how I understand it (this is in reference to the top image):
1x images are for the original iPhone through the 3GS - 'standard' resolution devices (3.5" screens)
2x images are for the iPhone 4 and 4S (3.5" Retina screens) and are also used for the iPhone 6.
Retina 4 2x are for the iPhone 5 and 5s (4" Retina screens)
3x images are for the new iPhone 6+ (5.5" super-Retina [3x] screen)
I believe that the iPhone 6 (4.7" screen) will use the Retina 4 2x images, but I would have to test it.
Side note, when I create a Launch Image inside my xcassets file, I am shown these options, which basically has all the device I am supporting. Just wondering why this is not also the case when creating an Image Set
If you compare the two images, the lower one has everything the upper one does, except for a 1x iPhone graphic. You don't need that if you're only supporting iOS 7 and above, since iOS 7 doesn't run on any non-Retina phone-form devices. To be honest, I don't understand why the top image has a 1x iPhone form graphic option - maybe because you checked the "iPhone" box in the sidebar?
Also how do you guys approach creating images/sprites for a universal application
For most non-fullscreen images (like a logo), you really only have 3 resolutions to support - standard (1x), Retina (2x), and the iPhone 6+ (3x). These are simply different quality of images, not really different sizes. So if you have a 10x10 image on a standard device, that would mean you need a 20x20 image on a Retina device and a 30x30 image on an iPhone 6+. On all devices, they would show up as a 10x10 image.
A great tool I used for managing different resolutions of icons is iConify.
I create them at the highest size I need (30x30 [#3x] for an image I want to be 10x10 on a device), then save it as a png and resize copies to 20x20 [#2x] and 10x10 [standard]. A better solution would be to create and use vector graphics, which would resize better to any size.
In 1x place image with resolution 320 x 480.
In 2x place image with resolution 640 x 960.
In Retina 4 2x place image with resolution 640 x 1136.
in 3x place image with resolution 1242 x 2208.
Images of Retina 4 2x will upscale to resolution 750 x 1334.
Images 3x will downscale to resolution 1080 x 1920.
You can also visit this links for launch screen images:
http://www.paintcodeapp.com/news/iphone-6-screens-demystified
http://www.paintcodeapp.com/news/ultimate-guide-to-iphone-resolutions
For all other images resolution and size:
https://developer.apple.com/ios/human-interface-guidelines/graphics/launch-screen/
https://developer.apple.com/ios/human-interface-guidelines/graphics/image-size-and-resolution/
https://developer.apple.com/ios/human-interface-guidelines/graphics/custom-icons/
How to use Image.xcassets:
https://www.youtube.com/watch?v=_36Y6rDcKP0&list=PLXCowKcXAVgrCe2Lezv0acRf4adQLshv2
Hope this will be more helpful.
If you have your launch images in an xcasset file, you can do the following in Xcode 6.
Select the launch image asset, select a specific resolution (1x, 2x, Retina 4, etc) and open the attributes inspector (see image below).
Under the "Image" section, you will have a "Expected Size" attribute.
Inside images.xcassets, you can add different devices support by right clicking as shown in the snap
Edit: Well, it doesn't seem working when I drag n drop images to placeholders. It gets messed up as shown next
I don't know why it is acting odd on my Xcode 6.4 though.
Edit#2:
I see a bug from apple here. I can select 'Universal' along with any device upon right click as you can see in the first image above. But via attribute inspector I can correctly select either 'Universal' or specific devices as shown here
Edit#3:
In Xcode 7 the attribute inspector has been changed and now it gives option same like the right click. So instead of either 'Universal' or specific devices, now it offers to select all.
There is one tool : AVXCassets Generator with which you can directly generate XCAssets file for all your icons and images just by one click.
hope you will like it.

Resources