Auto-rotation
(Fire-alarm shortened)



CS175

Chris Pollett

Oct 1, 2014

Outline

Auto-Rotations

Mechanics of Auto-Rotations

Specifying Rotation Support

Per-Controller Rotation Support

Using Interface Constraints with Rotations

More on Interface Constraints with Rotations

  • If we click on a label and then from the Menu go to Select Tools > Size Inspector we can see what constraints we have on an item.
    Size Inspector Screenshot
  • We can then tweaks these to our hearts content.
  • At the bottom of the panel with the storyboard we also have four icons:
    Constraint Icons
    These are bring up controls respectively for: Alignment, Pining Constraints, A Menu for Resolving Auto Layout issues, and a a Resizing Behavior menu. These can also be useful for adding constraints.
  • As a second example of what we can do with constraints. Suppose we wanted to drag a label and have it always positioned mid-way between the UL and LL labels.
  • We could drag a label out into our story board and position it mid-way between these two labels. We'll know this because at the position a dashed blue horizontal line will appear. Then we can go to Editor : Align : Vertical Center in Container to add the desired constraint.
  • Suppose we have two adjacent labels which we would like to each occupy half of the screen width regardless of the screen orientation. I can first select both labels then go to Editor : Pin : Horizontal spacing to achieve this.
  • Finer Grain Control

    Our Controller

    What it looks like

    Portrait Layout of Our App
    Landscape Layout of Our App

    Logging

    Starting Data Persistence