I have a TextView
that I'm dynamically adding text to.
in my main.xml
file I have the properties set to make my max lines 19 and scrollbars vertical.
in the .java
file I am using textview.setMovementMethod(new ScrollingMovementMethod());
to allow for scrolling.
The scrolling works great. As soon as 19 lines are taken up, and more lines are added it starts scrolling just as it should. The problem is, I want the new text to scroll into view.
I am writing out the value for textview.getScrollY()
and it stays at 0
no matter what (even if I manually scroll it down and add a new line of text).
consequently textview.scrollTo(0, textview.getScrollY());
does nothing for me.
Is there another method I should be using to obtain the vertical scroll amount for the textview
? Everything I've read says that for all intents and purposes, what I'm doing should be working :/
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…