Horizontal scrolling TextView to divide long text into pages (like Kindle)?
Hey, I have a TextView with long text, TextView.length=~29000.. 开发者_运维知识库Is there an example of making the TextView horizontally scrollable with each scroll comes a new page? a good example is the ebook reader Amazon Kindle app for Android.. the text isnt divided to pages either.. Thanks.
I would actually look into using the ViewFlipper class for this. Have three child views: a previous page, the current page, and the next page. When you load the text, you'll have to do some calculations to figure out how much text fits on each page. Every time you flip to the right, set the previous TextView to the text of the last current TextView, set the new current TextView to that of the last next TextView, then set the text for the new next page, and vice versa for flipping to the left.
精彩评论