You most certainly forgot to add constraints, or added wrong constraints.
To add constraints, Ctrl+click or simply right clic on the view, and while clicking, drag & drop to the superview, then select the appropriate constraints.
You can hold shift while choosing constraints to select multiple constraints, and then hit "Add Constraints".
Appropriate constraints are usually Top, Right, Left and Bottom for very simple views.
That means you set "I want the left of that view to be at 10 units of that view". Or " I want 10 units between that view and that other view".
Its a matter of setting distance between two objects. That's a rougly summarized explanation.
I suggest you play around with it, and follow guides about constraints, because they're not easy to learn at first. And also start with "simple" views :P
You can also drag & drop constraints between views themselves, not specifically superview (to create spacing constraints, or if you want two views to have "Equal Widths" for example).
All views, at all times, must have enough constraints for X, Y, W & H. If one is missing, you'll have a red warning.
Yellow warning means, most of the time, that what you're seeing is not exactly what will be rendered. You can simply "Resolve all" and the IDE will realign everything, and you can always ctrl Z if that's not what you wanted.