I’m starting this series of articles describing some of the issues I encountered along the way for which I could not find too much documentation online, or the documentation I could find was vague.
Today’s issue is having a multiline TextView and programmatically adding new lines to it. Consider the TextView in the gist below. It holds about 10 lines, and any subsequent line gets hidden.
I wanted two things:
- To be able to scroll the TextView
- Adding a new line to the TextView to automatically scroll this line into view.
For the first point, the solution is this:
For the second point:
A full implementation can be found here, and the code for the current article in in Activity_1. The other activities are for other, future articles.