新增畫面並在畫面之間瀏覽Add a screen and navigate between screens

建立包含多個畫面的應用程式,並為使用者新增在畫面之間瀏覽的方法。Create an app with multiple screens, and add ways for users to navigate between them.

必要條件Prerequisites

新增並重新命名畫面Add and rename a screen

  1. 在 [常用] 索引標籤上,按一下或點選 [新增畫面]。On the Home tab, click or tap New screen.

    [常用] 索引標籤上的 [新增畫面] 選項

  2. 在右側窗格中,按一下或點選畫面名稱 (在 [屬性] 索引標籤上方),然後輸入新名稱來源In the right-hand pane, click or tap the name of the screen (just above the Properties tab), and then type the new name Source.

    重新命名預設畫面

  3. 新增另一個畫面,並將其命名為 [目標]。Add another screen, and name it Target.

    在左側導覽列中的兩個畫面

新增導覽Add navigation

  1. 選取 [來源] 畫面之後,開啟 [插入] 索引標籤、按一下或點選 [圖示],然後按一下或點選 [下一步箭頭]。With the Source screen selected, open the Insert tab, click or tap Icons, and then click or tap Next arrow.

    [插入] 索引標籤的 [圖形] 選項

  2. (選擇性) 移動箭頭,讓它顯示在螢幕的右下角。(optional) Move the arrow so that it appears in the lower-right corner of the screen.
  3. 選取箭頭之後,按一下或點選 [動作] 索引標籤,然後按一下或點選 [巡覽]。With the arrow still selected, click or tap the Action tab, and then click or tap Navigate.

    箭頭的 OnSelect 屬性會自動設定為 Navigate 函式。The OnSelect property for the arrow is automatically set to a Navigate function.

    OnSelect 屬性設定為 Navigate 函式

    當使用者按一下或點選箭頭時,[目標] 畫面會淡入。When a user clicks or taps the arrow, the Target screen fades in.

  4. 在 [目標] 畫面上,加入 [上一步箭頭],並將其 OnSelect 屬性設為以下公式:On the Target screen, add a Back arrow, and set its OnSelect property to this formula:
    Navigate(Source, ScreenTransition.Fade)Navigate(Source, ScreenTransition.Fade)
  5. 開啟 [預覽] 模式 ( 或按 F5),然後按一下或點選您新增的箭頭,便可在畫面之間切換。Open Preview mode ( or press F5), and then switch between the screens by clicking or tapping the arrows that you added.
  6. 按下 Esc 鍵以返回預設工作區。Press Esc to return to the default workspace.