Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

android

I have a TextView which I will add various lines of text to. I have placed the TextView within a ScrollView 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?

like image 885
D-Dᴙum Avatar asked Dec 08 '25 03:12

D-Dᴙum


1 Answers

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.

like image 80
Noel Avatar answered Dec 10 '25 18:12

Noel



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!