Problem in setting the background

  1. I tried adding the constraints one by one as well, but it just doesn’t work.
  2. I already tried adding them all at once as well.

You’re trying to just make the background full screen?

If you set the Content Mode for the ImageView to Aspect Fill that blue will fill the entire background. Is that what you we’re trying to achieve?

(edit) The other issue I thought you might be having is that the top of the imageView is pinned to the safe area rather than the Superview. If you select the ImageView and then select the size inspector (the ruler) look at the constraint that says 'Align Top to: and it will be set to Safe Area.

To fix that and make the ImageView occupy the entire screen, double click on that constraint and it will open up into a more detailed view of that constraint.

That says that the Top of the ImageView is Equal to the Top of the Safe Area. I suspect you want it to be the Equal to the Top of the Superview so click on the drop down list for the Second Item and select Superview at the bottom of the list. Xcode will still think that you want the top aligned to the Safe Area so it will add 44 to the Constant value so that it looks like what you just tried to do made no change at all. Change the Constant to 0 and you will see the top of the ImageView snap to the Top.

Now when you run the App the blue background will occupy the entire screen.

any idea what could be wrong? pls

Hey @Christopher_Quijada,

Try setting the View Mode to “Aspect Fill”. This should make the image fill the entire screen. If this doesn’t work, try also setting all constraints of the image to 0 and unchecking Constrain to margins

Check out what Mark said on the other thread as well…
Let me know if this works!