How to make uiHTML document fill up window

6 visualizaciones (últimos 30 días)
Ephraim Bryski
Ephraim Bryski el 1 de Jul. de 2022
Respondida: Saffan el 30 de Ag. de 2023
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 comentarios
Kojiro Saito
Kojiro Saito el 1 de Jul. de 2022
I couldn't reproduce this issue in R2021b. How does your code look like?
Ephraim Bryski
Ephraim Bryski el 2 de Jul. de 2022
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>

Iniciar sesión para comentar.

Respuestas (1)

Saffan
Saffan el 30 de Ag. de 2023
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:

Categorías

Más información sobre Migrate GUIDE Apps en Help Center y File Exchange.

Etiquetas

Productos


Versión

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by