How do I make ListBox items wrap?

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일

0 개 추천

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:

카테고리

도움말 센터File Exchange에서 Desktop에 대해 자세히 알아보기

제품

릴리스

R2022a

질문:

2023년 4월 22일

답변:

2023년 4월 22일

Community Treasure Hunt

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

Start Hunting!

Translated by