Unable to position uihtml component with 'normalized' 'Units

Good evening everyone,
I was having some trouble trying to position a uihtlm component from a figure option from its property 'Position', however I find myself a little bit stuck as all the documentation I was able to find regarding positioning of uihtml refers to the units in 'Pixels' instead of 'normalized'.
Can someone confirm me if this is the case and uithtml positioning can't be normalized? I'm normalizing everything in my GUI, as it is possible that several monitors with different resolutions end up using my app.
Thanks in advance ! :)

3 件のコメント

dpb
dpb 2026 年 1 月 20 日
uihtml doc does, indeed confirm that the 'Position' property is in units of pixels and provides no alternatives.
Ignacio
Ignacio 2026 年 1 月 20 日
Thanks for the feedback! That was my main worry.
Guess I'll have to use the additional ui elements and panels position in order to roughly refer. A possible workaround I'll think may be valid is to convert the figure units to pixels, apply the modification to my uihtml and then convert the figure units again back to normalized.
dpb
dpb 2026 年 1 月 20 日
That's probably the best available approach. There is a CreateFcn callback that could be triggered.
I found another post from some time ago that complained that the new uibutton unlike former GUIDE button also is only in pixels. A (imo, rather rude) Mathworks reply was basically "live with it!" with a link to the uifigure doc page with the comment to use the 'SizeChangedFcn' callback and recalculate. No examples, no nothing else...

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

回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeMaintain or Transition figure-Based Apps についてさらに検索

質問済み:

2026 年 1 月 20 日

コメント済み:

dpb
2026 年 1 月 20 日

Community Treasure Hunt

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

Start Hunting!

Translated by