window size in matlab's app designer

조회 수: 146 (최근 30일)
nathan blanc
nathan blanc 2021년 3월 10일
댓글: Adam Danz 2021년 3월 22일
edit: attached the app
when designing an app in the app designer (2020b), the size of the window seems to vary when I run it in differen PCs. I mean the size of the window after running the app.
In some computers part of the app itself is cut and cannot be accessed by the user.
is there a way to fix this?
Nathan
  댓글 수: 4
Aghamarsh Varanasi
Aghamarsh Varanasi 2021년 3월 17일
Can you attach the app ?
nathan blanc
nathan blanc 2021년 3월 17일
편집: nathan blanc 2021년 3월 17일
attached. note that this is only a part of the app- none of the buttons work. but the buttons are not the issue. also note that it might work well on your computer as it does on mine. the issue is that this is computer dependent.

댓글을 달려면 로그인하십시오.

답변 (1개)

Adam Danz
Adam Danz 2021년 3월 16일
편집: Adam Danz 2021년 3월 17일
From the component browser in AppDesigner, select the figure handle and check the Window Appearance & Position properties in the properties inspector.
If the WindowState is set to maximized or fullscreen then the AutoResizeChildren should be checked so that different the app components will maintain their relative positions with monitor sizes.
Update
You also need to make these changes in the startup function. This will allow the app to fully render before resizing the figure.
function startupFcn(app)
%app.UIFigure.WindowState='maximized'; % <--------- remove
app.System_Inert.Items = app.Material_list;
app.System_Reactive.Items = app.Material_list;
app.System_Reactive.Value = 'Water';
drawnow(); pause(.05) % <--------- add
app.UIFigure.WindowState='maximized'; % <--------- add
end
  댓글 수: 14
nathan blanc
nathan blanc 2021년 3월 20일
Yes, I mean the picture you referenced. The files look identical in the app designer, but different when the app is intitialized. this is exactly my problem. we are looking at the same file, i just double checked.
btw in your screenshot from when the app is initlaized it seems that the buttons are "cut" on the right side. the "speaker" button for instance. if they are indeed cut then this is a similar problem. in my computer screen the buttons are not cut.
Adam Danz
Adam Danz 2021년 3월 22일
I see what you mean.
I played around with it a bit more and the repositioning is really buggy. For example, when I run the app attached in my comment above the app is maximized by the statup fcn and there are errors in component placement. Then I manually shrink the figure and the components do not resize, they are just cut off. But then when I manually expand the figure by draging a corner, the button resizing starts to take effect. I'd contact tech support and let us know what they say.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Startup and Shutdown에 대해 자세히 알아보기

제품


릴리스

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by