Appdesigner Panel Positions are wrong. How do I fix it?

23 vues (au cours des 30 derniers jours)
Dc215905
Dc215905 le 9 Juil 2021
Hello,
I have layed out all of the panel information in design view; however, when I open the app, certain panels move to positions that are not ideal. The Image below shows how the panels are layed out in desgin view (left image) and what happens when I open the app (right image). I will say, that the scrambling is not an issue in matlab 2021a , but it is an issue in 2020a. Any suggestions?
  1 commentaire
Mirko Hrovat
Mirko Hrovat le 6 Sep 2023
I also have a similar problem and I am using 2022a release.
In the code created by app designer, I have " app.NContours.Position = [151 113 30 22];"
In the layout the position of the control is " [163,50,55,22]"
why don't they match?
Also, in this app this is the only control that seems to be off.

Connectez-vous pour commenter.

Réponses (1)

Mirko Hrovat
Mirko Hrovat le 6 Sep 2023
I found one workaround. Copy the control and place it in the same panel so know you have two controls with slightly different names. Rename the old control (like adding "_bad" to it), then rename the new control to your original name.
Now you have to search through your code replacing "_bad" in all of the app variables. You will also have to add the callbacks you need copying the callback code you used in the original control. After all this you can then delete the "_bad" control. This deletes the old callbacks as well.
I presume a link to the control's position might have broken. The new control behaves as expected.

Catégories

En savoir plus sur Develop Apps Using App Designer dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by