How to make components in uitabgroup align to center of uifigure window when UIFigure.WindowState = 'fullscreen' using AppDesigner?

6 Ansichten (letzte 30 Tage)
I have designed an app that sets app.UIFigure.WindowState = 'fullscreen' on opening. In the UI I am using a tab group each tab of which covers the whole UI panel. When UIFigures is set fullscreen, the tabbed groups still fill the panel, but the components on the group are aligned top left, and I would like them to be in the centre of the UI window in fullscreen mode. I have a grid layout active on the UI.
I've tried accessing UITabGroup.Position, but that is read-only in AppDesigner (and I'm unsure if that would help, because it's not the position, but the alignment of the components in the tab group, which is the issue).

Akzeptierte Antwort

Michael
Michael am 6 Okt. 2023
The way to do this is to 1. apply a grid layout to the top level panel on which the tab group appears, set this to one column and one row with 'weight', then 2. apply another grid layout to the tab group in which the components are. By setting the outermost columns and rows of the grid to 'weight' (rather than fixed), the components can float within the expanded window. Depending on the particular layout, the inner rows and columns of the grid can be 'fixed' (to maintain the inner layout), or 'weight' as desired to achieve the intended layout.

Weitere Antworten (0)

Kategorien

Mehr zu Develop uifigure-Based Apps finden Sie in Help Center und File Exchange

Produkte


Version

R2023b

Community Treasure Hunt

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

Start Hunting!

Translated by