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

8 ビュー (過去 30 日間)
Anna Case
Anna Case 2020 年 5 月 17 日
回答済み: TED MOSBY 2025 年 8 月 20 日 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

回答 (1 件)

TED MOSBY
TED MOSBY 2025 年 8 月 20 日 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!

カテゴリ

Help Center および File ExchangeDevelop Apps Using App Designer についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by