How to make uiHTML document fill up window

I'm using uiHTML to create an UI for my MATLAB code, but the UI only fills up a portion of the window. In the attached image, the window is full screen and the black region is the body. This doesn't happen if I run it without MATLAB. Does anyone know how to expand it to fill up the window?

댓글 수: 2

I couldn't reproduce this issue in R2021b. How does your code look like?
My MATLAB code:
fig=uifigure;
h=uihtml(fig);
h.HTMLSource = 'G:\My Drive\GitHub\calcs\test.html';
My HTML:
<body></body>
<style>
body{
background-color: black;
}
</style>

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

답변 (1개)

Saffan
Saffan 2023년 8월 30일

0 개 추천

Hi Ephraim,
You can achieve this by setting the position of HTML UI component to fill the entire figure as shown in the following code snippet:
fig=uifigure;
h=uihtml(fig);
h.HTMLSource = 'test.html';
h.Position = [1 1 fig.Position(3) fig.Position(4)];
Refer to this for more information:

카테고리

도움말 센터File Exchange에서 Startup and Shutdown에 대해 자세히 알아보기

제품

릴리스

R2021b

태그

질문:

2022년 7월 1일

답변:

2023년 8월 30일

Community Treasure Hunt

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

Start Hunting!

Translated by