Domanda

Where do I have to put App Images and Toolbar Icons in iOS Project?

How will iOS pict the right image for retina and non retina images and for iPhone and iPad?

Does the app always ships with app images? For example when I download an App will it contains also the images for iPad?

È stato utile?

Soluzione 2

You can store your images anywhere. When you add them to the project, you'll have the option to either link to the original files or copy the images to the project folder.

Choosing retina and non-retina images is handled automatically by the operating system. Simply give the retina versions of the images the @2x suffix. When you call [UIImage imageNamed:@"my_image.png"]; on a retina device, it will use the retina version (my_image@2x.png).

Yes, when you download the app, it will include the image assets. If you right click the app bundle and select "show package contents," you'll see all of an app's image assets.

Also, see this answer.

Altri suggerimenti

The first question is essentially opinion based. You can put images for your app anywhere in your project. Where you should put them is up to how you want to organize your project really.

For retina vs non-retina, it's pretty easy. Put someImage.png and someImage@2x.png in your project. Anywhere you use someImage, the image with @2x will automatically be used for retina devices.

As for what's loaded onto devices, your entire project is bundled up into a single package and distributed to every device that downloads it from the app store.

You should have a xcassets folder in your project. It where you put you images files.

And this is the naming convetion for images. With this way iOS will know which image to load.

name~iphone.png

name@2x~iphone.png

name~ipad.png

name@2x~ipad.png

name-568h@2x~iphone.png

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top