構建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,不確定您的答案被刪除之前是否看到我的回覆。我希望能夠對齊來自多個子面板的組件,因此它們都需要位於同一個控制組中。 –