本文介绍了拆分一个TextView到相对屏幕高度多TextViews的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以,我有什么,我认为一个相当复杂的问题。我有这种大规模的TextView就是几屏的长度长。我想要做的是什么了分裂的TextView成更小的TextViews,可见屏幕(因此,没有垂直滚动)的每个的高度,并把小TextViews在水平滚动画廊。我能做到后者没有问题,但我想不出打破了TextViews的好办法。

So I have what I consider a rather complex problem. I have this massive TextView that is several screen lengths long. What I want to do is split the TextView up into smaller TextViews, each the height of the visible screen (So no vertical scrolling), and place the smaller TextViews in a horizontal-scrolling Gallery. I can do the latter no problem, but I can't think of a good way to break up the TextViews.

另外值得一提的TextView的内包含了很多不同风格的文字(不同的尺寸,间距等)。

It's also worth noting the TextView contains many different styled text within it (different sizes, spacing, etc).

我不一定要找的解决方案,但建议将是有益和AP preciated。

I'm not necessarily looking for solutions, but suggestions would be helpful and appreciated.

推荐答案

您应该看一看。它们提供你所谈论的水平分页,与Android的viewflow被适配器的支持。

You should take a look at AndroViews or android-viewflow. They provide the horizontal paging that you're talking about, with android-viewflow being backed by an adapter.

在分手TextView的方面,你也可以继承的 onMeasure(),并开始搞清楚大小那里。你也可以考虑看是怎么做的,因为它pretty多不正是你再谈论。

In terms of splitting up the TextView, you can subclass the onMeasure() and start figuring out sizes there. You could also look into seeing how FBReader does it, as it pretty much does exactly what you're talking about.

这篇关于拆分一个TextView到相对屏幕高度多TextViews的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-15 06:45