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

17 ビュー (過去 30 日間)
Dc215905
Dc215905 2021 年 7 月 9 日
回答済み: Mirko Hrovat 2023 年 9 月 6 日
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 件のコメント
Mirko Hrovat
Mirko Hrovat 2023 年 9 月 6 日
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.

サインインしてコメントする。

回答 (1 件)

Mirko Hrovat
Mirko Hrovat 2023 年 9 月 6 日
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.

カテゴリ

Help Center および File ExchangeDevelop Apps Using App Designer についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by