Main Content

本页翻译不是最新的。点击此处可查看最新英文版本。

App 构建组件

App 设计工具和 UI 图窗支持大量组件,可用于设计功能齐全的现代化应用程序。下表列出了可用的组件。

  • 常用组件 - 包括响应交互的组件,如按钮、滑块、下拉列表和树。

  • 坐标区 - 包括用于创建绘图以进行数据可视化和探查的坐标区。

  • 容器和图窗工具 - 包括用于对组件分组的面板和选项卡,还包括菜单栏。

  • 仪表组件 - 包括用于可视化状态的仪表和信号灯,以及用于选择输入参数的旋钮和开关。

  • 可扩展组件 - 包括您创建的自定义 UI 组件。与第三方库对接以显示小组件或数据可视化等内容。

  • 工具箱组件 - 包括工具箱的 UI 组件。需要安装相应的工具箱并具备许可证。

所有组件都可以通过编程方式使用。App 设计工具组件库中还提供了大多数 UI 组件,您可以将它们拖放到画布上。要向使用 App 设计工具创建的 App 添加组件库中没有的组件,或要将组件动态添加到正在运行的 App,请参阅以编程方式向 App 设计工具添加 UI 组件

在 App 设计工具中调用图形函数的工作流与通常在 MATLAB® 命令行中使用的工作流略有不同。有关如何在 App 设计工具中调用图形函数的详细信息,请参阅在 App 设计工具中显示图形

常用组件

坐标区

坐标区信息示例
UIAxes 属性

A mesh surface plot

Axes 属性
此对象只能以编程方式添加。

Two normalized histogram plots in the same axes. A blue histogram is centered near zero and an orange one is centered near one.

GeographicAxes 属性
此对象只能以编程方式添加。

Set of geographic axes that uses the 'colorterrain' basemap. A solid red line is plotted between two points: Imperial Beach, California and San Francisco, California. The two end points are marked with red asterisks.

PolarAxes 属性
此对象只能以编程方式添加。

Scatter chart in polar coordinates

容器和图窗工具

对话框和通知

对话框信息示例
uialert
此对象只能以编程方式添加。

An Invalid File dialog box displayed in front of a UI figure. A red octagon icon with a white exclamation point appears to the left of an alert message that says "File not found".

uiconfirm
此对象只能以编程方式添加。

A Confirm Save dialog box with the message "Saving these changes will overwrite previous changes." The options it presents are "Overwrite", "Save as new", and "Cancel".

uiprogressdlg
此对象只能以编程方式添加。

A progress dialog box displayed in front of a UI figure. The message displayed above the progress bar says "Loading your data". A blue progress bar shows that the process is one-third complete.

uisetcolor
此对象只能以编程方式添加。

Color picker dialog box that shows the standard colors, recent colors, and preview of the default color which is set to yellow

uigetfile
此对象只能以编程方式添加。

File selection dialog box

uiputfile
此对象只能以编程方式添加。

Save to file dialog box

uigetdir
此对象只能以编程方式添加。

Folder selection dialog box

uiopen
此对象只能以编程方式添加。

Load file into workspace dialog box

uisave
此对象只能以编程方式添加。

Save workspace variables dialog box

仪表

可扩展组件

工具箱组件

在 App 设计工具中创建的或使用 uifigure 函数创建的 App 支持 Aerospace Toolbox 组件。有关详细信息,请参阅Flight Instruments (Aerospace Toolbox)。要使用工具箱组件,需要安装关联的工具箱并具备有效的许可证。

相关主题