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

19 Ansichten (letzte 30 Tage)
Dc215905
Dc215905 am 9 Jul. 2021
Beantwortet: Mirko Hrovat am 6 Sep. 2023
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 Kommentar
Mirko Hrovat
Mirko Hrovat am 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.

Melden Sie sich an, um zu kommentieren.

Antworten (1)

Mirko Hrovat
Mirko Hrovat am 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.

Kategorien

Mehr zu Develop Apps Using App Designer finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by