How to successfully add an image to a Storyboard in Xcode 6 in Swift?

I am very new to Xcode (2 days), and still I find it pretty frustrating. I'm just trying to add an image to my ViewController application through a Storyboard, but it does not appear on the simulator. Can anyone help me out?

+7
source share
3 answers
  • If you are trying to create an example Xcode project, you can find the "Images.xcassets" folder in the project. Drag the image to this folder.
  • then go to the storyboard, focus on your "image view".
  • in the list of attributes, the "Image" field, you can select the drop-down menu in it.
  • attempt to run in simulator

Good luck

+18
source

After uploading your image to the “Assets.xcassets” folder, you will need to find the “Attribute Inspector” on the “Right Side Inspectors” tab. Focus or click on "View Image", which you should place as a holder on the storyboard. On the right tab under the attribute inspector (looks like a down arrow next to the ruler) you can select an image from the drop-down list. You can also change the content mode to Aspect Fit while you are there.

0
source

Here are some details about Xcode 10.

  1. Edit the storyboard, create an image. Wayne said, add the image you want in Images.xcassets.

  2. Click on your image:

enter image description here

  1. Do View → Inspectors → Show Inspector attribute
  2. Select an image:

enter image description here

0
source

Source: https://habr.com/ru/post/983943/


All Articles