Xcode projects with Images.xcassets

Asked

Viewed 368 times

1

In iOS projects created by Xcode, you have a "folder" called Images.xcassets, i.e., an Xcode Assets catalog.

  • In this catalog, I add an image to a UIButton for example, and this image I am required to keep it within the project? Or only in Images.xcassets?

  • Inside Images.xcassets, when I add an image for example, it presents the Overview, which has in the case three spaces, which are respectively 1x, 2x and 3x. Am I required to set all three for the image to appear on an iPhone retina? Or if I set only at 1x it will appear on all other devices?

1 answer

0


The xcassets "file" is actually already a directory, if you click on an xcassets item with the right button and click on "Open in Finder" Voce you will see the path the image is in. You don’t need to put another reference for her in the project.

If Voce does not have 2x and 3x images, the shown image will be at 1x resized to 2x or 3x size.

  • Remembering, that the "indexing" of images made through xcassets is done through JSON (Xcode itself generates this), making the image names do not need to be the same as the image in xcassets. To the friend of the question, the best option, is to set at least the 3x image

Browser other questions tagged

You are not signed in. Login or sign up in order to post.