Book Image

Application Development in iOS 7

By : Kyle Begeman
Book Image

Application Development in iOS 7

By: Kyle Begeman

Overview of this book

Table of Contents (15 chapters)
Application Development in iOS 7
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Resolving Auto Layout issues


After seeing our application running on an iPhone, it may be in our best interest to move the buttons down just a bit for a more balanced layout. Return to Xcode, and select both buttons by holding down the command key and clicking on each. Move them down a few pixels based on preference.

You will notice that suddenly there are two dashed red lines surrounding our buttons. Xcode does not automatically update constraints when a view is manually repositioned, so now the previous calculations are no longer valid. The dashed red lines let you know there is an error with our constraints that requires correction.

Thankfully, Xcode has some handy features available to help correct these issues. From the menu bar, navigate to Editor | Resolve Auto Layout Issues | Update Constraints. This can also be accomplished using the fourth button to the bottom-right corner of the storyboard. By selecting this, Xcode will recalculate the previous constraints based on our view's current...