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

 採用された回答

Turlough Hughes
Turlough Hughes 2022 年 1 月 4 日

0 投票

Use the ColumnSpacing property:
g.ColumnSpacing = 1;

1 件のコメント

Jan Kudlacek
Jan Kudlacek 2022 年 1 月 5 日
Great, exactly what I needed. Thank you :-)

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File Exchange で Develop Apps Programmatically についてさらに検索

製品

リリース

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by