I'm working on a class that adds a component to an app figure and I don't want the component to change size when the figure resizes. Obviously, I could turn AutoResizeChildren off for the figure, but I don't want to do that as I don't know if whomever created the figure wants to keep that behavior. I know if I put the component in a container like a panel,tab, etc it will shield it from resizing, but that doesn't really work in my scenario either. Has anyone figured out a workaround in this situation?

답변 (1개)

Image Analyst
Image Analyst 2022년 5월 27일

0 개 추천

Calling your code will place a widget on the figure window of an app the user built with App Designer I presume? Or are you using GUIDE? Can you set the Units properties to 'characters' instead of normalized? Then your widget won't scale if the user resizes their app's window.

댓글 수: 4

Austin Decker
Austin Decker 2022년 5월 27일
You're correct. I'm assuming non-guide apps.
Image Analyst
Image Analyst 2022년 5월 27일
OK, so is there a units property? Did you try what I said?
Austin Decker
Austin Decker 2022년 5월 27일
편집: Austin Decker 2022년 5월 27일
I will give it a shot!
Austin Decker
Austin Decker 2022년 5월 27일
Right, so uipanel doesn't have 'character' units if it is created inside uifigure. Only in figure.

댓글을 달려면 로그인하십시오.

카테고리

도움말 센터 및 File Exchange에서 Develop Apps Programmatically에 대해 자세히 알아보기

제품

릴리스

R2021b

질문:

2022년 5월 26일

댓글:

2022년 5월 27일

Community Treasure Hunt

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

Start Hunting!

Translated by