Apps with auto-reflow are preconfigured app types that optimize the viewing experience by automatically adjusting the size, location, and visibility of the app content in response to screen size, orientation, and platform. Use apps with auto-reflow if you expect to run or share your apps across multiple environments or desktop resolutions.
Apps with auto-reflow extend the existing auto-resize behaviors that are on by default in all App Designer apps. These apps detect and adapt to the available screen size when they are first displayed. Both 2- and 3-panel apps have a large flexible-size panel, intended for visualizations like plots. As the app changes size, the large panel grows or shrinks, depending on the space available.
When an app is resized beyond a certain predefined threshold, the panels in the app reflow and reorder to make the best use of the space. As panels reorder themselves, they and the components in them dynamically adjust in size while extra space between components (whitespace) is also reduced.
When an app becomes very small, auto-resize stops eliminating whitespace and
resizing components. This can put some components outside the visible part of the
window. To access these components, set the
of the panels to
'on'. This enables scroll bars to appear when
The App Designer Start Page includes options to create new 2-panel and 3-panel apps with auto-resize and auto-reflow, and canvas interactions to guide app building. No additional code is needed to achieve the reflowing and resizing behavior.
You can also convert an existing app into an app with auto-reflow by expanding the
drop-down menu from the File
section of the Canvas tab and selecting
App with Auto-Reflow or
3-Panel App with
When you convert an existing app to an app with auto-reflow, App Designer:
Creates a duplicate of your app with
appended to the file name. Your original app file is not changed.
Automatically adds preconfigured panels to your app to provide the automatic reflow and resize behaviors.
SizeChangedFcn callback function in order
to control the layout of the app as the figure is resized.
In some cases, after App Designer has converted your app, you may need to update your callback code or the position of some components. This table describes some examples of adjustments you that you may need to make.
App Designer tries to maintain the relative positions of your components, but you may need to make some minor adjustments.
Adjust the position of components as needed.
|Callback code does not behave as expected|
When the preconfigured panels are added to your app the hierarchy of the components in your app changes. If your callbacks reference components based on their parent, they may need to be updated.
|Update the parent of the components in your callbacks.|
|Existing ||Apps with auto-reflow generate their own
||After your app has been converted, modify or remove the
This app has components within panels that have auto-reflow behavior. Controls for data selection are parented to the left panel and data visualizations are parented to two tabs in the right panel. Run the app and change the size of the app window. The app content resizes and reflows based on the app window size.