Is there a way by which we can programmatically enforce iPhone 6 device to take either Retina4-2x or 3x graphics instead of 2x graphics from asset catalog? Presently, I noticed that iPhone 6 is picking 2x graphics, instead of Retina4-2x.
iPhone 6 uses 2x graphics because it can only display up to such density. Retina4-2x and 2x has no difference, its the same scale.
You should read the excellent article at PaintCode. However, it would seem you're missing the fact that iPhone 6 uses #2x and iPhone 6+ uses #3x.
Related
I apologise if this has been answered but I can't seem to understand no matter where I look. I have been trying to make a Chess game using SpriteKit in Xcode. I don't understand the 1x, 2x and 3x options in the assets folder.
It seems like the image is the smallest when I put it in 3x, which seems counter-intuitive. Also, what resolution is best to design for? It doesn't seem like the actual iPhone resolutions are used in the iOS simulator.
Thanks
You get a great overview from apples docs:
https://developer.apple.com/library/ios/documentation/UserExperience/Conceptual/MobileHIG/IconMatrix.html
Basically, you need images with higher resolution for devices with higher resolution. If an icon is 32x32 pixel for iphone 3, you add an 64x64 image for iphone 4 (retina, #2x) and an 96x96 image for iphone 6 (even higher resolution, #3x).
1x , 2x , 3x is different size of images according to different phone's resolution.
You can find imagesize according to device resolution in below link.
IconMatrix
Basically,
#1x images are for the iPhone 3GS - 'standard' resolution devices (3.5" screens)
#2x images are for the iPhone 4 and 4S which contain 3.5" Retina screens and 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+,iPhone 6S+ (5.5" super-Retina [3x] screen)
Note :- As describe by apple in document
For all images and icons, the PNG format is recommended
Also, what resolution is best to design for?
The biggest resolution you will need. In most cases, #3x. So if the image "is" 10x10, design it being 30x30 for the #3x files, and scale down to smaller resolutions.
• 30x30 is the pic#3x.png
• 20x20 is the pic#2x.png
• 10x10 is the pic.png
The simulator uses the image according to the device it is simulating. So the iPhone 6S+ will use #3x if available.
PNG is the recommended extension, and you can use http://tinypng.com to reduce the file size, including splash screens.
There seems to be a confusion for me regarding Sketch 3 workflow and exporting Artboards for all iPhones in Sketch 3.
I understand that 1x resolution is for iPhone 3GS and below, 2x for
iPhone 4/4S/5/5S/6/6S and 3x is for 6Plus. So does that mean If I
create Artboards for iPhone 6 and export in 2x it would be for iPhone
4/5/6 and if I export at 3x it would be for 6plus regardless of what
dartboard I'm using?
Or should I have different dartboards for each iPhone and export #1x #2x and #3x for each of them?
I have been looking for a solid answer for days but could not find one that actually works. According to this link :
"if you were designing at 1x with the 6Plus (414x736) art board, exporting your assets at 1x would be for 3G/3GS devices, 2x would be for 4/4S/5/5S/6 devices, and finally 3x would be for the 6Plus."
However after I tested that I get different results:
Exporting iPhone 6Plus (414x736) at 1x = 414x736 2x = 828x1472 and 3x = 1242x2208. Shouldn't that be 750x1334 for 2x ?
What if I want to use PDF vector assets so I don't have to export 1x, 2x and 3x separately. Which Artboard should I export the 1x PDF from?
Overall I'd love to know what's the best approach to design and export for multiple iPhones.
Thanks in advance! :)
The density selection in Zeplin is a way of telling the app that, the Sketch artboards are in #1x or #2x or #3x. So, Zeplin will calculate the assets size based on that. You don't have to work on different sizes (#1x, #2x, #3x & PDF).
If your Sketch artboard is 1242 x 2208 pixels (iPhone 6Plus, 6S Plus, 7Plus) then you have to choose the density as #3x in Zeplin.
So make sure you select the right density in Zeplin.
Zeplin – Choosing right screen size while importing from Sketch?
I'm using the smaller to bigger approach. If your design work on the smaller screen it should be fine on other.
So I start with a 375x667px artboard and then export the assets as #1 #2 for iPhone and #3 to sizes plus.
I coded an App, its done now but if I go to Images.xcassets, it looks like I need 1x 2x and 3x pictures. I tested the App on my iPhone 6 and everything runs fine. My pictures are all in the 1x Boxes.
( its an universal App ).
I guess if I test it on iPhone 4 now, the images will be too big or the other way, on an iPad the images will be too small. I think thats why I need those 1x 2x 3x, am I right?
Could somebody tell me, how I get my 1x pictures now converted to 2x and 3x?
Thanks for any help
Those images are for different screen DPI. E.g. Retina in iPhone 4 will use 2x images and Retina in iPhone 6 Plus will use 3x images, while 1x images will be used on old non-retina devices like iPad 2.
If you want to use different sized image on iPhone 5S and on iPhone 6 you need to provide it as different asset and set it in the code.
I simply want to display a title page to a game. I want to use pre-rendered images. It needs to work with all iPhones and iPads. So far I am using these assets as screenshot below
I have used these sizes:
In 1x place image with resolution of 320 x 480.
In 2x place image with resolution of 640 x 960.
In Retina 4 2x place image with resolution of 640 x 1136.
In 3x place image with resolution of 1242 x 2207.
Only the iPhone 4 and 5's show correctly. Both 6 and 6Plus are completely wrong.
for iPad:
1x image of 760*1024
2x image of 1536*2048
Only the iPad 2 displays correct. The Air and Retina are completely wrong.
I have read through all the documentation I can find both on here and searching for hours on Google. I am unsure what simple thing I must be overlooking. Am I trying to do something that is not possible? I am only testing on the simulator and thinking it could be an issue with that?
Also I may have a misunderstanding then as I was under the impression that #3x was for iPhone 6 and 6+. If not, what are #3x for?
For some reason Image Sets in Asset Catalogs do not include a size for iPhone 6 or iPhone 6+, so when using a full screen image you may need to handle it manually via code.
What I'm doing (and it's not pretty but it works), is to include another Image Set for iPhone 6 (I all it imageName_47), and another one for iPhone 6+ (I call it imageName_55). Then in code, detect the screen size and swap the image to the best size. You'll only need the #2x version for the _47 one, and the #3x version for the _55 one.
I my application i'm trying to set images in imageView pragmatically. i'm using separate images for iPhone 5 and iPhone 6. What would be the suffix iPhone 6 images? as #2x is for iPhone 5 images.
It is the same, there is #3x for Iphone 6+.
Please refer https://developer.apple.com/library/ios/documentation/UserExperience/Conceptual/MobileHIG/IconMatrix.html#//apple_ref/doc/uid/TP40006556-CH27-SW1
#2x is not a suffix exactly for iphone5 - it's reprepresent of how much real pixel in one point in this image, so it can be used in any numbers of devices (available and new) what will have display with double density. As for iPhone 6+ (exactly 6+ for now) it use triple density display, so it used now #3x suffix.
You can do what you want programmatically - detect device and use the name you want. But #2x and #3x will be used (if available) dependently of device.