Opening and closing views

Opening and closing views in Skylight

What does this recipe include?

This recipe has two views: the root view and a second view. The root view has several different cards, each showing a different way to open the second view. These include:

  • Using the "Open view" action

  • Using the "Open view" action and specifying a card to go to once the view is open

  • Using the skylight.openView method in a card script

  • Using the skylight.openView method in a card script and specifying a card to go to once the view is open

  • Using the skylight.openView method in a card script and clearing the view stack, making the second view the only view in the stack.

Specifying a particular card

On non-wearable devices, specifying a particular card has no effect. On wearable devices, the card that is specified will be focused once the view appears.

A card that is bound to an array of data, thus repeating the card, cannot be specified.

Specifying the new view to be root

Setting root to true when opening the view will clear the view stack and place the new view as the only view in the stack. This means that if the user closes that view, they will be taken back to the Skylight applications list.

‚Äč