Overview
Play gives you control over how your prototype behaves in portrait and landscape orientations. You can set an initial orientation, choose which orientations your project supports, and use interactions to adapt your design when the device rotates.
Orientation changes can trigger actions through Device Events, and conditions based on Expression Editor properties like isPortrait, isLandscape, or device.orientation let you define behavior specific to each orientation.
Choosing an Initial Orientation
In Design or Interaction Mode, you can set the device’s initial orientation using the button below the device preview.
Your design remains the same in both Portrait and Landscape, so we recommend choosing a primary orientation in the Editor and then using interactions to adjust the secondary orientation, if needed. You can preview the secondary orientation on your iPhone, iPad, or in the Simulator.
To control which orientations your project supports, use the Project panel (visible when nothing is selected) and check the orientations you’d like to enable. Supported orientations will display when the device is rotated; unsupported orientations will not.
Prototyping with Orientation
Instead of designing separately for portrait and landscape, you can use interactions to adapt your design when the orientation changes.
Trigger Actions on Orientation Change
When a user rotates their device, you can trigger actions with a Device Event. There are three orientation-related events:
Orientation Will Change fires just before the orientation changes
Orientation Is Changing fires while the device is rotating
Orientation Did Change fires immediately after the orientation changes
Conditions Based on Orientation
Triggers can fire different actions depending on the device’s current orientation. To do this, add conditions using orientation-related Expression Editor (EE) properties.
The EE properties isPortrait and isLandscape return booleans. When the device is in portrait, isPortrait is true and isLandscape is false, and vice versa. You can use these properties in a condition to trigger different actions based on the current orientation.
There is also an orientation property which will return the current orientation.
device.orientation