Chapter 8. Screen Resolution and Orientation Changes

In this chapter, we will cover:

  • Targeting a device
  • Targeting the Retina display
  • Supporting multiple resolutions
  • Setting the default aspect ratio
  • Enabling auto-orientation
  • Listening for orientation changes
  • Responding to orientation changes

Introduction

The inclusion of an accelerometer allowed the original iPhone to detect changes in its physical orientation; reflowing its on-screen content to suit the user's preference for either portrait or landscape viewing. Offering this, however, meant that an application had to be designed and coded for two screen aspect ratios—one for the portrait and another for landscape.

As the iOS family has grown, so too has the number of screen resolutions that must be supported. ...

Get Flash iOS Apps Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.