필터 지우기
필터 지우기

Fit buttons to full screen

조회 수: 10 (최근 30일)
Guillermo Cid Espinosa
Guillermo Cid Espinosa 2017년 10월 3일
댓글: Yair Altman 2017년 10월 6일
I want to visualize an interface made in app designer but when I maximize the interface to see it full screen the buttons do not fit and I do not know how to solve it.

채택된 답변

Yair Altman
Yair Altman 2017년 10월 3일
In App Designer, set the buttons' Units property to 'Normalized' instead of 'Pixels' (or whatever other value they currently have).
  댓글 수: 2
Guillermo Cid Espinosa
Guillermo Cid Espinosa 2017년 10월 3일
편집: Guillermo Cid Espinosa 2017년 10월 3일
But how I can access that property?. Because I cant write the next code app.Button.Units='normalized'; because that public property (Units) doesnt exist for class matlab.ui.control.StateButton. And I dont know in wich part of the code I have to change that property.
Yair Altman
Yair Altman 2017년 10월 6일
Controls created via App Designer (i.e. web-based) do not have the Units property. Panels do have this control, but when you try to set their Units to normalized Matlab issues an error. In short, App Designer [still] does not support normalized units.
As a workaround [until MathWorks enabled true normalized units], you can set a custom app.UIFigure.SizeChangedFcn callback to compute and update the button's position/size whenever the figure is resized. It's ugly but it should work.
Alternatively, use the standard (non-web-based) Matlab GUI, using either GUIDE and/or programmatic functions (figure, uicontrol, uipanel etc.). The buttons and panels created with uicontrol and uipanel (respectively) have true normalized units.

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Migrate GUIDE Apps에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by