Crear componentes personalizados de la IU
Cree sus propios componentes personalizados reutilizables de la IU para usar en apps
Cree sus propios componentes personalizados de la IU para usar en las apps o para compartir con otras personas. Puede usar componentes personalizados para extender la funcionalidad de componentes de la IU actuales; para dividir apps grandes en fragmentos independientes y fáciles de mantener, y para diseñar una interfaz para que los usuarios personalicen y reutilicen un componente en múltiples apps. Cree componentes personalizados de forma interactiva en App Designer o de forma programática creando una subclase de la clase básica ComponentContainer
. En ambos casos, puede configurar los componentes para utilizarlos de forma interactiva en apps de App Designer.
Clases
matlab.ui.componentcontainer.ComponentContainer | Base class for developing custom UI component objects (desde R2020b) |
Métodos
Funciones
appdesigner.customcomponent.configureMetadata | Configure custom UI component for use in App Designer (desde R2021a) |
appdesigner.customcomponent.removeMetadata | Remove custom UI component from App Designer (desde R2021a) |
Temas
Crear componentes en App Designer
- Create a Simple Custom UI Component in App Designer
Walk through the basic steps to interactively create a simple custom UI component. - Create Public Properties for Custom UI Components in App Designer
Create and validate custom UI component property values by specifying data types, default values, and property validation functions. - Create Callbacks for Custom UI Components in App Designer
Create public callbacks for your custom UI component that can be used to program the component behavior in an app. - Define Custom UI Component Startup Tasks in App Designer
Perform one-time startup tasks when a custom UI component is first created in an app. - Verify Behavior of Custom UI Components in App Designer
Verify that the public properties, callbacks, and display of your component appear and behave as expected. - Write Property Set Methods for Custom UI Components in App Designer
Perform custom validation of public properties by writing set methods for those properties. - Create Event Data for Custom UI Component Callbacks
Define event data associated with a callback that provides information about a user interaction. - Write Tests for Custom UI Component
Write automated tests to verify the behavior of a custom UI component.
Crear componentes de forma programática
- Develop Custom UI Components Programmatically
Walk through the basic steps to author a custom UI component class using MATLAB® functions. - Manage Properties of Custom UI Components Programmatically
Validate property values, optimize how properties update, and customize how properties display for the UI components you author. - Create Custom UI Component With HTML
Use HTML UI components to author custom UI component classes with more flexibility.
Usar y compartir componentes
- Configure Custom UI Components for App Designer
Enable interactive use of your custom UI components in App Designer. - Configure Property Display for Custom UI Components in App Designer
Design public properties of your component to enable users to easily use the component in an App Designer app.