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

3 次查看(过去 30 天)
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).

采纳的回答

Michael
Michael 2023-10-6
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.

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Develop uifigure-Based Apps 的更多信息

产品


版本

R2023b

Community Treasure Hunt

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

Start Hunting!

Translated by