Xcode 8 does not show images in storyboard

After the xcode update, all the images in the storyboard appear as question marks (since they do not find them). I tried to remove / add them, clear the derived data, but still all image representations show quesiton marks. If anyone knows what could be the problem?

+6
source share
5 answers

I had the same problem, and I found out that this is because I do not have an image in the size corresponding to the “View As” device selected in the storyboard (bottom left).

If you select a device that requires an @ 2x image (example: iPhone 6s), and you only have an @ 3x image (like me), you will see a question mark. If you add an image size that matches the size of the device you are using for the storyboard, the image will appear in your image.

Basically, you want to have an image in all three sizes: @ 1x, @ 2x and @ 3x.

+18
source

This is not a problem if you run a project, and the image is displayed in the simulator. Once you change the size classes , then this happens. for example, if you use several size classes, such as wA,hA and wC,hr , and you set restrictions for any,any and compact,regular , and if you save any,any selected in the interface, then it will display images correctly but if you change to compact,regular then it will be a question mark boot due to simulated metrics size . Thus, if this does not affect the output, this is not a problem!

0
source

For your images you need to use the xcassets directory:

1) Access Assets.xcassets

enter image description here

2) Create a new set of images or select from the list and update the existing one

enter image description here

3) Place your image options in your @ 1x, @ 2x and @ 3x sizes :

enter image description here

Call your image in your code, for example:

 let image = UIImage(named: "NewImageName") 
0
source

Well, I was in the same situation and found out that the xcode 8 storyboard removes frames, so the images are not displayed. Therefore, you must set the appropriate restrictions on uiimageviews, and then you have to impose restrictions by writing this code.

 UIImageView *uiv = [cell viewWithTag:100]; [uiv setNeedsUpdateConstraints]; [uiv setNeedsLayout]; [uiv layoutIfNeeded]; 
0
source

If you have only 3x images in your assets that you want to work with, and you have already selected the initial view of the device on some 2x device, follow these steps:

  • Open storyboard file in Xcode 8.
  • Go to File Inspector -> Document Builder Document.
  • Opens In -> Select Xcode 7.x
  • Save and close the storyboard.
  • Open the storyboard again and select “Initial Appearance” on iPhone6s Plus.
0
source

All Articles