War Card - Background

Hi Chris,

Love the tutorials!

I am using XCode11 and when following your tutorials for the War Card game I seem to be hitting a few obstacles.

Mainly, when adding the background image, after un-checking ‘constrain to margins’ and setting all constraints to ‘View’, the background on the X axis automatically resets to ‘Safe Area’ and therefore I am left with white spaces right from the start. Please you could point me in the right direction?

Cheers

Mmmmh, it might be a Xcode bug. What I usually do it delete the constraint or try to modify them in the constraint settings.

Let me know if you were able to fix that and post a screenshot.

1 Like

Dear select Aspect fit will solve it.

Xcode 11.3 On the war card game I could not get the background to stop flipping back to the safe area when I added the 4 constraints. So I went to the attributes inspector and selected each constraint. I took away a constant -1 from the top and the trailing and added +1 to the constant on the leading and the bottom edge. Eureka! It works.

This is the same problem I’ve been having. I’m pretty sure I followed the tutorial exactly, but am still left with white margins that the background doesn’t cover. I’m not sure what to do next. I’ve deleted and tried again, but no luck. I’ve tried changing the aspect fit and it did not work. Here’s my screenshot:

@M_Peinado

There is a bug in Xcode.
Add each constraint individually rather than all 4 at once.
So do for example top (set to 0), then click “add 1 constraint”
Repeat for all sides

3 Likes

You’re awesome, thank you so much. I literally thought I was going crazy. I’m new to Xcode, so I wasn’t sure if it was just me not being able to figure it out. Thanks!!!

2 Likes