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

조회 수: 9 (최근 30일)
Anna Case
Anna Case 2020년 5월 17일
답변: TED MOSBY 2025년 8월 20일
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일
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 CenterFile Exchange에서 Develop 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