Clear Filters
Clear Filters

Grid Layout and Tab Group

13 views (last 30 days)
Mirko Maurici
Mirko Maurici on 18 Apr 2019
Edited: Alice on 14 May 2019
I recently upgraded to r2019a, and I'm wondering if anybody experienced the same issue with the new feature Grid Layout in app designer.
I'm trying to fit a tab group in a certain region
Cattura.PNG
but when I run the app this is what I get
Cattura2.PNG
The tab group won't keep the position.
Any solution?
thanks

Accepted Answer

Alice
Alice on 19 Apr 2019
Edited: Alice on 14 May 2019
Unfortunately, this is a regression in R2019a.
The workaround is to temporarily place the tab group in a different cell, then call drawnow, then place it back to its real location.
Example (outside AppDesigner):
f = uifigure;
g = uigridlayout(f);
c = uibutton(g);
tg = uitabgroup(g);
% Workaround:
%
% set it temporarily in a different location
tg.Layout.Row = 2;
% call drawnow
drawnow;
% set it back to its real location
tg.Layout.Row = 1;
Example (in AppDesigner):
% 1. Drag a tab group in a cell, e.g. row 3, column 1
% 2. Create a startup function and place the workaround in it, e.g.
%
% set it temporarily in a different location
app.TabGroup.Layout.Row = 4;
% call drawnow
drawnow;
% set it back to its real location
app.TabGroup.Layout.Row = 3;
Note:
The temporarily location MUST be different from its actual location.
To make sure that is the case, you can set the temporary location to a cell 'outside' the grid, for example, if the grid is of size 5x5, set the temporary Row to 6.
Another way is to add 1 to the row (or column), then place it back.
Bug report:
Please see the corresponding bug report for the latest info on the releases / updates in which this will be fixed:

More Answers (0)

Categories

Find more on Migrate GUIDE Apps in Help Center and File Exchange

Products


Release

R2019a

Community Treasure Hunt

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

Start Hunting!