Change font size of every components in uifigure(app designer) by following the uifigures's size

20 visualizzazioni (ultimi 30 giorni)
I've created several uifigures by app designer.
And now I am trying to change the font sizes of every components (ex) Label, tabel, textbox etc... following the uifigure's window size.
I mean if the uifigure size is increased then font sizes are also increased, if uifigure is decreased then also decreased.
But it was answered for figure which was created from GUIDE not App Designer so when I tried, the command
h = findall(gcf, '-property', 'fontsize')
This made a new figure not found current uifigure's property.
So I am wondering there's any other solution which can solve my problem.
Well, if it's hard to do it in app designer, then is it possible to convert uifigure into figure not breaking the file?

Risposta accettata

Jae Heon Kim
Jae Heon Kim il 12 Feb 2020
Don't mind people!
I've figured out!
For app designer,
I coded like this!
app.UIFigure.Position(3)
app.h = findobj(app.UIFigure, '-property', 'FontSize');
app.hFontSize = cell2mat(get(app.h,'FontSize'));
position = app.UIFigure.Position;
widthF = position(3);
newFontSize = double(widthF) * app.hFontSize / 1463.0;
set(app.h,{'FontSize'}, num2cell(newFontSize));
  4 Commenti

Accedi per commentare.

Più risposte (0)

Categorie

Scopri di più su Develop uifigure-Based Apps in Help Center e File Exchange

Prodotti

Community Treasure Hunt

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

Start Hunting!

Translated by