Determine size of programmatic layout
이전 댓글 표시
I am designing a tool to create an app programmatically using uifigure and its various containers. I specifically plan to use uigridlayout in order to take advantage of its automatic sizing using 'fit'. After the figure is laid out, I would like to resize the uifigure to the size of the enclosed layout.
- This would be trivial if the uigridlayout had a 'Position' property.
- I can look at the 'Position' property of all the widgets contained in the uigridlayout to calculate the maximum width and height, but note that those values are only relative to the enclosing layout (the uigridlayout). If I nest a uigridlayout inside another uigridlayout, I have to perform this operation recursively to find the overall dimensions.
- I assume the same holds true for any nested containers
Is there an easier way?
댓글 수: 3
Norton Allen
2021년 11월 29일
Matthew Reaves
2021년 12월 26일
I am also interested in this issue. I am working on a UI. I organized uilabel's and uieditfield's into uipanel's, arranging them using a uigridlayout whose parent is the uipanel. I would like that panel to automatically resize to fit the entire contents of the uigridlayout, but it does not appear that this is supported.
Norton Allen
2021년 12월 26일
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Develop Apps Programmatically에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!