Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iphone 6 vs iphone 5 image Naming Convention

How to set corresponding MYimage.png for MyimageView in Xcode 6 with ios 8.x compatiblity.

MyimageView setImage:[UIImage imageNamed:@"MYimage.png"];

In Resources, I am having the following images with resolutions:

MYimage.png--320*480

[email protected]*960

[email protected]*1136

[email protected]*1334

[email protected]*2208

For iPhone 4s,it shows: [email protected] [Right]

For iPhone 5s,it shows: [email protected] [wrong]

For iPhone 6,it shows: [email protected] [wrong]

For iPhone 6+,it shows: [email protected] [wrong]

But after renaming the images as mentioned below:

MYimage.png--320*480

[email protected]*960

[email protected]*1136

[email protected]*1334

[email protected]*2208

For iPhone 4s,it shows: [email protected] [Right]

For iPhone 5s,it shows: [email protected] [wrong]

For iPhone 6,it shows: [email protected] [wrong]

For iPhone 6+,it shows: [email protected] [Right]

So., What's the stated format to implement?

Note: Also googled following Links and so on..

like image 215
Vikas Rajpurohit Avatar asked Oct 02 '14 12:10

Vikas Rajpurohit


People also ask

What is iPhone Photo naming convention?

The iPhone correctly names photos with the date and time they were taken.

Are iPhone 5 and iPhone 6 the same size?

Design And Size - Bigger, Heavier But Stronger iPhone 5 – 123.8 x 58.6 x 7.6 mm (4.87 x 2.31 x 0.30 in), 112 g (3.95 oz) iPhone 5S – 123.8 x 58.6 x 7.6 mm (4.87 x 2.31 x 0.30 in), 112g (3.95 oz) iPhone 6 – 138.1 x 67 x 6.9mm (5.44 x 2.64 x 0.27 inches), 129g (4.55 oz)

Is iPhone 6 camera better than 5S?

Big camera enhancementsThe 5S boasts an 8MP rear sensor, but the 6S comes packing an improved 12MP version. Much of the tech from the 6 has been carried over too, things like ultra-pixels that let in more light. Slo-mo video is supported on both, though the iPhone 6S adds 240 fps support to the iPhone 5S's 120fps.


2 Answers

iOS only supports the size notations for launch images, for example this page describes the usage for 3.5", 4", and iPads in the format [email protected], etc.

What you're actually only able to support is @2x and @3x (see here) which explains why on each of the devices you're seeing it pick up the @2x and @3x pngs only.

Lastly, the [email protected]*h isn't a valid size denotation either; those files won't be read by the system automatically when you reference an image named MYimage.png; at most you could do [email protected] and [email protected].

Answering your question below:

iPhone 6 and iPhone 5 both render at the same pixel density. UI elements should be positioned correctly in the UI at the same point size on both devices.

For example:

iPhone 5       iPhone 6
|      |      |        |
|      |      |        |
|      |      |        |
|[bttn]|      |        |
|______|      | [bttn] |
              |________|

If you're displaying an photo in a UIImageView though, you can just create the largest size and let it either scale down to the iPhone 5 (using UIViewContentModeScaleAspectFill) or leave it as-is (using UIViewContentModeCenter).

In the end, you really don't want to have to manage specific dimensions for every single device out there - already if you're including 2 high-res assets for each element, that's a lot of storage space. Adding one for every device is unnecessary, and Apple never intended for that to be the case.

like image 97
brandonscript Avatar answered Sep 30 '22 16:09

brandonscript


You don't need to specify what screen size the image is for, but only what density it is.

There are 3 density groups:

  • 1x: iPhone 3GS and previous; iPod Touch 3rd gen and previous; iPad 2 and previous; iPad Mini 1st gen;
  • 2x: iPhones 4, 4S, 5, 5S and 6; iPod Touch 4th and 5th gen; iPad 3 and newer; iPad Mini 2nd gen;
  • 3x: iPhone 6 Plus;

To each group, you should add an image named with the pattern "[email protected]", where the density can be omitted for 1x.

Examples:

For a better use and organization of your image resources, you should consider using Asset Catalogs. They will also help you understand what image sizes you will need depending on what devices you will support, and you will not need to care about each individual file name.

like image 26
Guilherme Avatar answered Sep 30 '22 17:09

Guilherme