Forum Archive

How to tell a TextView to scroll?

starrshaw

Hi, I have info printing into text view.. but as I append new data it will not scroll the textview.. but just show 1 line of the new data and you have to scroll to see the rest manually with a finger scroll. Is there any way to fix this or am I stuck?

abcabc

See this example posted few days ago. (The scroll function is based on a post by JonB sometime ago).
https://gist.github.com/balachandrana/6c8617382079e4486b12a4dd35f5c8c5

starrshaw

Thanks Abcabc!

starrshaw

Here is the only function you need to do the TextView scroll. The function will just read your 'textview' content and offset. Works great!

def scroll():
v['textview1'].content_offset = (0, v['textview1'].content_size[1] -v['textview1'].height)