I'm very new to Xcode (2 days) and so far I'm finding it fairly frustrating. I'm just trying to add an image to my app's ViewController via he Storyboard, but it does not appear on the simulator. Could someone assist me?
How to successfully add an image in Storyboard in Xcode 6 in Swift?
Asked Answered
This is probably an auto layout issue. Just select your imageView at your storyboard, go to menu Editor > Resolve Auto Layout Issues > Reset to Suggested Constraints –
Vogele
- if you are trying an example project of XCode, you may find a "Images.xcassets" folder in project. Drag your image into this folder.
- then go to storyboard, focus on your "Image View".
- in the attributes list, "Image" field, you can choose the image in it's drop-down menu.
- the try running in simulator
good luck!
No idea what the "attributes list" is. I don't see any fields or headers with that label. This answer was almost exactly what I need, now that Apple seems to require a storyboard for submission. –
Crossroads
Here are some details on xcode 10.
Edit the story board, create an image view. Wayne stated, add the image you want in the Images.xcassets.
Click on your image view:
- Do View -> Inspectors -> Show Attribute Inspector
- Select the image:
After loading your image in the " Assets.xcassets" folder you will need to find the "Attributes inspector" under your right side inspectors tab. Focus or click on your "Image view" that you have to place as a holder on the storyboard. On the right tab under the attributes inspector (looks like a down arrow next to the ruler) you can select your image from the drop-down selection. You may also want to change Content mode to Aspect Fit while you are there.
© 2022 - 2024 — McMap. All rights reserved.