构建GUI与guide
一个可能的解决方案是:
- 增加主要
uipanel
- 添加在主`uipanel”
- 对准他们所有的
checkbox
(例如通过选择其中的一些然后使用指南工具栏上的Align Objects
工具
- 将
uipanel
添加到checkbox
的某些上,它将覆盖“复选框”
- 选择辅助
uipanel
- 上单击鼠标右键,弹出右键菜单
- 选择
Send to Back
选项
如果你想创建GUI“编程“您可以:
- 创建
figure
- 添加主面板与uipanel
- 添加的复选框与uicontrol设置
Style
属性checkbox
和position
属性,使得它们将被放置在主面板
- 添加辅助uipanel。此外,在这种情况下,二次
uipanel
会掩盖checkbox
- 推副面板背面使用uistack功能
Thsi是一个可能的实现
% Create the figure
figure
% Add the Main uipanel
p1=uipanel('units','normalized','position',[.1 .1 .5 .7],'title','Main Panel')
% Add come checkboxes
cb1=uicontrol('parent',p1,'style','checkbox','units','normalized', ...
'position',[.1 .7 .3 .1],'string','checkbox 1')
cb2=uicontrol('parent',p1,'style','checkbox','units','normalized', ...
'position',[.1 .6 .3 .1],'string','checkbox 2')
cb3=uicontrol('parent',p1,'style','checkbox','units','normalized', ...
'position',[.1 .5 .3 .1],'string','checkbox 3')
% Add the Secondary uipanel
p2=uipanel('parent',p1,'units','normalized','position',[.05 .4 .4 .5], ...
'title','Secondary Panel')
% Push the secondary uipanel back
uistack(p2,'bottom')
希望这有助于。
Qapla'
@Suever,不确定您的答案被删除之前是否看到我的回复。我希望能够对齐来自多个子面板的组件,因此它们都需要位于同一个控制组中。 –