Grid Layout and Tab Group

7 次查看(过去 30 天)
Mirko Maurici
Mirko Maurici 2019-4-18
编辑: Alice 2019-5-14
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

采纳的回答

Alice
Alice 2019-4-19
编辑:Alice 2019-5-14
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:

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Develop Apps Using App Designer 的更多信息

产品


版本

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by