O'Reilly logo

iOS® 8 for Programmers: An App-Driven Approach with Swift™, Third Edition by Abbey Deitel, Harvey M. Deitel, Paul J. Deitel

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

2.5.8 Using Auto Layout to Support Different Screen Sizes and Orientations

Though the design appears to be complete, if you were to run the app now using the iOS simulator, you’d see various problems (if you’d like to run it now, see Section 2.6):

• The Label and Image View will not resize based on the device and orientation.

• On an iPhone in portrait orientation the Label and Image View will be too wide for the screen, and in landscape orientation the screen will not be tall enough to display both components.

• On an iPad, the Label and Image View will be too small to fill the screen and will be positioned at the screen’s left edge.

You use auto layout constraints to specify how UI components are positioned relative to other components and ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required