How to decrease margins around uibutton in uigridlayout?

8 vues (au cours des 30 derniers jours)
Jan Kudlacek
Jan Kudlacek le 4 Jan 2022
Commenté : Jan Kudlacek le 5 Jan 2022
Dear colleagues
How can I shrink the margins around buttons created by uibutton() in the grid layout manager? I would prefer them packed next to each other.
Thank you for any suggestions
Jan Kudlacek
f = uifigure('Position', [200 200 280 60]);
g = uigridlayout(f);
g.RowHeight = {'1x'};
g.ColumnWidth = repelem({'1x'}, 9);
for kb = 1 : 9
uibutton(g, 'push', 'Text', ['B', num2str(kb)])
end

Réponse acceptée

Turlough Hughes
Turlough Hughes le 4 Jan 2022
Use the ColumnSpacing property:
g.ColumnSpacing = 1;

Plus de réponses (0)

Catégories

En savoir plus sur Develop Apps Using App Designer dans Help Center et File Exchange

Produits


Version

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by