Erstellen benutzerdefinierter UI-Komponenten
Erstellen Sie Ihre eigenen benutzerdefinierten UI-Komponenten, die Sie in Ihren Apps nutzen oder für andere freigeben können. Sie können mithilfe benutzerdefinierter Komponenten die Funktionalität der vorhandenen UI-Komponenten erweitern, große Apps in unabhängige und besser verwaltbare Teile aufsplitten und eine Schnittstelle entwickeln, in der die Benutzer Komponenten App-übergreifend anpassen und wiederverwenden können. Erstellen Sie benutzerdefinierte Komponenten interaktiv in App Designer oder innerhalb des Programms, indem Sie eine Unterklasse der Basisklasse ComponentContainer
erstellen. In beiden Fällen können Sie Ihre Komponenten so konfigurieren, dass sie interaktiv in den App-Designer-Apps genutzt werden können.
Klassen
matlab.ui.componentcontainer.ComponentContainer | Base class for developing custom UI component objects (Seit R2020b) |
Methoden
Funktionen
appdesigner.customcomponent.configureMetadata | Configure custom UI component for use in App Designer (Seit R2021a) |
appdesigner.customcomponent.removeMetadata | Remove custom UI component from App Designer (Seit R2021a) |
Themen
Erstellen von Komponenten in 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.
Erstellen von Komponenten im Programm
- 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.
Nutzen und Freigeben von Komponenten
- 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.