How to make a Text Area auto-scroll to bottom (created in app designer)
71 次查看(过去 30 天)
显示 更早的评论
I created a Text Area in app designer. It is populated with status messages as the app runs. After a while the area fills with lines of text, and the vertical scroll bar appears, but new messages are written in the invisible part of the area. The user has to scroll down "by hand". How can I make the Text Area autoscroll, so that each new message is visible?
1 个评论
Eric Sargent
2020-12-9
As of R2020b uitextarea now supports scroll.
In this case you could use:
scroll(textArea, 'bottom')
采纳的回答
Eric Sargent
2020-12-9
As of R2020b uitextarea now supports scroll.
In this case you could use:
scroll(textArea, 'bottom')
更多回答(1 个)
Chris Portal
2017-8-5
If it's possible to use a listbox instead of a text area, you would be able to use the scroll function to programmatically scroll specific items into view:
https://www.mathworks.com/help/matlab/ref/scroll.html
1 个评论
Marko Antila
2019-2-14
编辑:Marko Antila
2019-2-14
Scroll function does not work properly with App Designer List Box, unfortunately:
- in startFcn it hides the List Box (permanently)
- in callbacks it does exactly nothing
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Migrate GUIDE Apps 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!