MATLAB: Is the slider label separating from the slider

MATLAB

I have an application made in App Designer and the automatic resize behavior is proving very strange. When I resize my application, the slider text and the slider itself separate. Why is this occurring and how do I keep them together?

Best Answer

The slider label and the slider are separating with resize due to the fact that the app contains a table that was set to non-visible.
The table is placed inside the app, and even though it is not visible, it is being accounted for by AutoResizeChildren.
Remove the table if it is undesired. If it desired to have a table which is non-visible, see the following workaround:
- Place the table so that it is fully in the lower left quadrant (i.e. fully in the negative space, both horizontally and vertically).
- Create the table and size it during the app construction, and only change its data in the callback. When the Position property of a component is changed during run time, AutoResizeChildren 'resets' the layout, and therefore will not resize smaller than whatever size it was when the Position property was changed.