After updating xcode all images in the storyboard appeared as question marks (as it doesn't find them). I tried to remove/add them, cleared derived data but still all image views show quesiton marks. If anyone has any idea what might be the problem ?
I had the same problem and I found out that it's because I don't have the image in the size that corresponds to the "View as" device selected in storyboard (bottom left).
If you've selected a device that needs the @2x image (example: iPhone 6s) and you only have the @3x image (as I did) you will see the question mark. If you add the size for the image that corresponds to the device size that you are using for storyboard, the image will appear in your imageView.
Basically, you want to have the image in all 3 sizes: @1x, @2x and @3x.
This is not an issue if you run your project and your image displays in simulator. Sometime is you change size classes
then also this happens. for example if you are using multiple size class like wA,hA
and wC,hr
and you set constraints for any,any
and compact,regular
both and if you keep any,any
selected in interfacebulder then it will show images properly but if you change it to compact,regular
then it will shoe question mark
because of simulated metrics's size
. So, if it is not affecting output then it is not an issue!
Well I was in the same situation and came to know that xcode 8 storyboard removes frames and that is why images are not showing. Therefore you have to put appropriate constraints on uiimageviews and then you have to force constraints on by writing this code.
UIImageView *uiv = [cell viewWithTag:100];
[uiv setNeedsUpdateConstraints];
[uiv setNeedsLayout];
[uiv layoutIfNeeded];
If you have only 3x images in your Assets that you want to work with and you have already Chosen the Initial Device View to some 2x device, then do the following:
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.