Positioning problem with GUIDE

2 次查看(过去 30 天)
I've seen this question asked but not answered. When I run my GUIDE-designed GUI, the position of elements changes. In the image below (GUIDE on left, application on right), the --- Display Summary box is drawn differently. The box within doesn't have joined corners. The elements within are spaced differently. The Tabs are different sizes.
Is there some setting that I have overlooked that is screwing this up?

采纳的回答

Abhay Aradhya
Abhay Aradhya 2017-6-9
Because you are normalizing the units, the various tabs and boxes takes different sizes. That is because when you normalize you are declaring as a percentage of the parent. In your case I am guessing that it will be the "main guide window" or also called the "figure".
So in the GUIDE you will have editing tools and other stuff on your left which is not present in the application window (This can be seen in the photo you have put up), the application window thus always has a little more width than your GUIDE window hence the size of your components also tend to wary between the GUIDE and application window.
If you want it to be of fixed size then set the "Units" property to "pixels" and declare all the dimensions of your boxes, buttons and tabs in no of pixels.
popupMenu = uicontrol(topPanel,'Style','popupmenu',...
'String',solString,...
'Units','pixels',...
'Value',1,'Position',[100 250 220 50],...
'Callback',@popupmenuCallBack);
Just an example for your reference.

更多回答(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