Autolayout not working as described


#1

The first example is placing labels and buttons on the view and attempting to anchor them to the center and against each other using Auto Layout. Following the book, I am seeing different than Figure 1.20. At the bottom it indicates “Add 7 Constraints”, but what I am seeing is “Add 3 constraints”. I have meticulously followed the text multiple times with the same result. Once the constraints are added, the views (controls) stay centered, but move off the top of the view, which clearly isn’t correct.

Please advise.

P.S. I am using XCode 8.2.1.


#2

Solved! It wasn’t clear what selecting the “red vertical dashed segment” meant. It would have been a good idea to point this out graphically in the book. I’d refer to that “red vertical dashed segment” as an I-Beam…it’s definitely not dashed. Now I am seeing the expected behavior.