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

28 Ansichten (letzte 30 Tage)
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?

Akzeptierte Antwort

Jae Heon Kim
Jae Heon Kim am 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 Kommentare

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Develop uifigure-Based Apps finden Sie in Help Center und File Exchange

Produkte

Community Treasure Hunt

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

Start Hunting!

Translated by