添加和切换屏幕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. 添加另一个屏幕,然后将其命名为“Target”。Add another screen, and name it Target.

    左侧导航栏中有两个屏幕

添加导航Add navigation

  1. 选择“Source”屏幕后,打开“插入”选项卡,然后依次单击或点击“图标”和“前进箭头”。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”函数

    当用户单击或点击此箭头时,“Target”屏幕淡入。When a user clicks or taps the arrow, the Target screen fades in.

  4. 在“Target”屏幕上,添加“后退箭头”,然后将其“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.