How to keep the original layout in the full screen or when maximizing the GUI of a MATLAB App ?
26 次查看(过去 30 天)
显示 更早的评论
Hello everyone,
I am desinging an App in the MATLAB App Designer, I am using MATLAB R2023a, and I am working on a Windows operating system.
After finishing the design of my App, I have noticed that when running the App, the layout of the designed GUI is lost when the GUI is on full screen or when it is maximized. Please see the attached Capture1 and Capture2 for the layouts of the GUI (Capture1 shows the layout when the GUI is minimised, this is the original layout that I have designed, and Capture2 shows how the layout is changed when the GUI is on full screen or when it is maximized).
I want that the GUI keeps the original layout that I have set when I was designing the App in the App designer, when the GUI is on full screen or when it is maximized.
I have found on some answers of MATLAB Central that I Should select for WindowState "fullscreen" or "maximized" and that I should also select "Resize" and "AutoResizeChildren" in the Settings of POSITION. I have done all that, please see the attached Capture3, but I still have the same problem.
Does anyone have any solution for this problem ?
Many thanks to everyone in advance.
0 个评论
采纳的回答
Rik
2024-6-15
You should set the units to Normalized. That will scale the sizes of the buttons as you expect.
There is an art to this, since you might want your GUI to look good on VGA, as well as 4k.
You could consider using the ResizeFcn property to scale the font size as well.
5 个评论
Rik
2024-6-19
You need to set the Units property to 'Normalized'. Normally something this should do it:
app.object.Units='Normalized';
Although I admit I have never tested this in an AppDesigner app.
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File 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!