How do I make ListBox items wrap?

5 次查看(过去 30 天)
River Ma
River Ma 2023-4-22
I am using app designer and still getting familiar with it. I want each of the individual items to be wrapped text instead of a scroll bar. Is there any way to do this? Thank you!

回答(1 个)

chicken vector
chicken vector 2023-4-22
In general, for uicontrol components you would use textwrap, but it doesn't work in App Designer.
Some of them, such as uibutton, have a property named WordWrap that you can set to 'on', but, to my knowledge, you can't do it with with uilistbox.
The only option I think is do it manually, as suggested here.
lbox = uilistbox('Items', {['This is a' newline 'long list name'], ...
'Short one', ...
'Short two', ...
'Short three'}, ...
'Position', [125 120 100 78]);
Result:

类别

Help CenterFile Exchange 中查找有关 Desktop 的更多信息

产品


版本

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by