Problem with the Background

Hey all
I’m a total newbie to programming, and I have a rather simple problem.

I can’t get my background to line up with the view, when the phone is horizontal. Even though I have have chosen the correct constraints. Hope someone can help


Skærmbillede 2019-11-05 kl. 17.15.02

Thanks

  • Nick

Hey Nick, that’s indeed strange! Are you able to zip up your entire project folder and upload it here for me to take a look at? (Label the file with your name)

Thanks
Chris

Hey Chris, I have uploaded the zip file to the Dropbox link.
Hope to hear from you.
Thanks
Nick

Hey Nick, sorry i just got a chance to look into it now. Unfortunately i don’t have all the project files needed! Can you go up one directory and zip up the entire folder? Then reupload it? Thanks!

Hey Chris, I’m a total newbie to this programming stuff, but I’m gonna try my best to follow your instructions.
I have uploaded what I think is the entire folder.

  • Nick

Hey Nick,

Thanks for uploading your project! The problem is that this new version of Xcode has defaulted the “ContentMode” of the UIImageView to “Aspect Fit”. The ContentMode property tells the image how to stretch or compress depending on the space. Since it’s on “Aspect Fit”, it tries to fit the entire image in the space that it has.

In older versions of Xcode, it defaulted to “Scale to Fill” which tells the image to stretch to fill up all available space.

So to fix your issue, all you need to do is select your UIImageView, then on the right hand side attributes pane, change this content mode property to “Scale to fill”

Sorry for the back and forth and thanks for learning with us!

1 Like

Hey Chris,
Thank you very much for the help, I really appreciate it.

  • Nick
1 Like

Hi Chris I am new at this as well. I am having the same problem as Nick but my Scale to fit is in place. If I go to view on other devices the background only maintains the size and configuration of the original setup ( or close to it). Not sure what I am doing wrong.

It’s that you forgot to add the constraints to the background.

1 Like