UI Elements stacking order problem

7 次查看(过去 30 天)
Diego
Diego 2025-3-24
回答: Deepak 2025-3-28
In the app I designed in 2019a version of matlab when a Panel was put on top of the other components, they stayed behind until the panel is made invisible. I tried to run the same app in 2024b version and all the UITables, EditFields and other components appear on top no matter if there is any other component. I tried reordering and uistack and nothing works. In app editor it shows fine, as you can see in the photos.
  1 个评论
NVSL
NVSL 2025-3-27
I tried reproducing your issue by adding table, editfield and panel in the same order in appdesigner. However, when I run it in R2019a and R2024b, he panel (top element) appears covering the remaining.
Can you share the app you are facing this issue with or provide the sequence of elements that is causing the issue.
I am attaching screenshot of the app after running in R2024b.

请先登录,再进行评论。

回答(1 个)

Deepak
Deepak 2025-3-28
Hi @Diego,
It seems like you are experiencing a layering issue with your components in MATLAB 2024b. Here are a few steps you can try to resolve the issue:
1. Check Z-Order: Ensure that the panel is set to the highest z-order. You can use the "uistack" function to bring the panel to the front in your code:
uistack(app.Panel, 'top');
2. Parent-Child Relationship: Make sure the components you want behind the panel are children of the panel. If they are not, they might appear on top.
3. Visibility: Double-check the visibility settings of your components. Ensure that the panel is set to visible and others are set accordingly.
4. Recreate Components: If adjusting z-order doesn’t work, try recreating the panel and components in the App Designer.
5. Error Messages: Run the GUI and check the MATLAB Command Window for any error messages or warnings. These messages can provide clues about what might be going wrong.
Please find attached the documentation of "uistack" for reference:
I hope this assists in resolving the issue.

类别

Help CenterFile Exchange 中查找有关 Environment and Settings 的更多信息

产品


版本

R2024b

Community Treasure Hunt

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

Start Hunting!

Translated by