App Designer Reflow of Items within Tabs
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Michael
am 9 Aug. 2019
Kommentiert: galaxy
am 21 Sep. 2022
I have a tab group that is my highest level of organization in my app. Within each tab, I have a series of panels that I would like to reflow when the app is resized. Right now they don't, because they are in a tab group. Is is possible to get the panels within a tab group to reflow as panels do when not in a tab group? I have pasted a shot of my app. The tab group is evident, and I have highlighted the two panels I want to reflow.
Thanks in advance.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/233383/image.png)
0 Kommentare
Akzeptierte Antwort
Rajani Mishra
am 21 Aug. 2019
Reflow is possible if an app is built using the reflow template. Currently app designer does not provide panels within a tab group as a starting template. Currently app designer offers either two or three panels as a starting template.
You can start with the template currently available and design accordingly.
For more information refer : https://www.mathworks.com/help/matlab/creating_guis/apps-with-auto-reflow.html?s_tid=answers_rc2-2_p5_MLT
0 Kommentare
Weitere Antworten (1)
Melissa Williams
am 1 Okt. 2019
You can implement the reflow yourself by adding a 1 row, 2 column grid to the tabs and adding your panels to each grid cell. This is how the reflow is implemented in the 2 and 3 panel apps. If you take a look at the generated code for a 2 panel reflowing app and look at the updateAppLayout function, you will see the logic behind it.
3 Kommentare
Melissa Williams
am 16 Apr. 2020
- Drag a grid into the tab
- Set it to be 1 row, 2 columns (this will give you two boxes side by side)
- Add a panel to each grid cell (name the right panel RighPanel for code to work)
- Layout the components you want in each side.
- Add a sizeChangeFcn callback to your UIFigure
- Inside the callback add code like this
currentFigureWidth = app.UIFigure.Position(3);
if(currentFigureWidth <= 576) %<--update this to the width you want to reflow
% Change to a 2x1 grid
app.GridLayout.RowHeight = {480, 480}; %<--update this to be the height of figure when app starts
app.GridLayout.ColumnWidth = {'1x'};
app.RightPanel.Layout.Row = 2;
app.RightPanel.Layout.Column = 1;
else
% Change to a 1x2 grid
app.GridLayout.RowHeight = {'1x'};
app.GridLayout.ColumnWidth = {220, '1x'}; %<--update this to width of left side when app starts
app.RightPanel.Layout.Row = 1;
app.RightPanel.Layout.Column = 2;
end
galaxy
am 21 Sep. 2022
Could you please give a example ?. I tried, but it did not succesfull.
Thank you so much
Siehe auch
Kategorien
Mehr zu Develop Apps Using App Designer finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!