开发者

Automatic Vertical Scrolling of a TextView So The Last line Added Is Always Shown?

开发者 https://www.devze.com 2023-03-16 20:47 出处:网络
I have a TextView which I will add various lines of text to. I have placed the TextView within a ScrollVi开发者_运维问答ew to allow USER scrolling of the TextView however I want the TextView when it i

I have a TextView which I will add various lines of text to. I have placed the TextView within a ScrollVi开发者_运维问答ew to allow USER scrolling of the TextView however I want the TextView when it is full of text to automatically scroll up when another line is added.

I cannot find any solutions to this. Ther must be a way of automatically scrolling a TextView vertically. Can anyone help me?


I'm not sure how to do it in a TextView but you can use a ListView with android:transcriptMode="alwaysScroll" and android:stackFromBottom="true" to get that desired behaviour. See this Google IO talk at around 32 min.

0

精彩评论

暂无评论...
验证码 换一张
取 消