Lesson 4 user interface

Hello All,

I have a problem when trying when done adjusting all of the constraints in the user interface video as my iPhone 11 and iPhone Pro Maxx have the war cars label cut off at the top?? Any suggestions would be greatly appreciated.
Shallon Ogden

If you can, expand those stack views so that we can see a bit better what you have going on.

But before you do that try doing a vertical stack view which will have 4 rows for cards, Deal Button, Player Labels, and the Score. apply the constraints to the stack view so that it’s 0 all around.

Then in the top stack put a horizontal stack view in there which will be for your cards. apply constraints to that stack view. Then put your cards in there. see if that works for you.

And FWIW - I suck at constraints. So take everything I said with a grain of salt.

Thank you for your help, I apologize but I am somewhat confused. Should I start a new project and do these or am I applying these to my current project? Sorry im lost on these and I feel like maybe I should go back and watch the videos. Its different because chris does the tutorial with the iPhone XR and for some reason it is no longer in the available devices.

Hi @Shallon_Ogden,

The iPhone 11 and iPhone 12 are effectively the same size as the iPhone XR. Both will behave the same way as the iPhone XR in terms of screen layout and object locations in your Storyboard as they are the same “size class” even though the pixel density on the iPhone 12 is greater.

There is no real necessity to start a new project but it would be good practise for you in applying constraints.

You could remove all of the existing UI elements from the Storyboard and then re-create them if you wanted to by following the video again or you could just delete all of the constraints you have applied and redo them while following the video. Deleting constraints is easy. Just select them in the Document Outline panel and hit the delete key. Don’t try to add constraints on top of constraints as that will create what is called “Conflicting Constraints” which will cause you grief.

Either way, you will get some additional practise on constraints which is no bad thing in my view.

1 Like