How do I set the container of an App Designer component?

8 vues (au cours des 30 derniers jours)
Anna Case
Anna Case le 17 Mai 2020
Réponse apportée : TED MOSBY le 20 Août 2025 à 11:51
I am working on a large app in app designer and need to move some components around. The app has 6 layered containers (i.e. tabs) that the user can select on the left. I finally figured out that I can rearrange components that are not on the default/home tab by changing the visibility of the containers. However, when I go to a different tab in the "Design View" and drag a component, it is automatically moved to a different container or tab. How can I stop this behavior?
Thanks

Réponses (1)

TED MOSBY
TED MOSBY le 20 Août 2025 à 11:51
Hi,
Open the Component Browser and drag the component under the target container (Panel/Tab/GridLayout), When dropped, App Designer changes the parent; the tree updates to show the component nested under the new container. Hence you can verify the target container there.
Every App Designer UI component has a Parent you can set. Assign it to the destination container (panel, tab, grid, etc.). If the destination uses a GridLayout, also set the component’s Layout position.
% Example: move a button from Panel1 to Tab2
app.Button.Parent = app.Tab2; % re-parent
% If Tab2 contains a GridLayout:
app.Button.Parent = app.GridLayout2; % new parent is the grid
app.Button.Layout.Row = 2; % place it
app.Button.Layout.Column = [1 2];
Here is some documentation for reference:
Hope this helps!

Catégories

En savoir plus sur Develop Apps Using App Designer dans Help Center et File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by