在文本转换器摆脱额外的空间 [英] getting rid of extra space in text switcher
问题描述
我有一个扩展的ViewFactory的活动。活动确实无非充当我的应用程序的文档越多,用5种不同的意见。
I have an activity that extends ViewFactory. The activity does nothing more than act as documentation for my app, with 5 different 'views'.
每个视图放置在滚动型里面一个TextSwitcher。我现在面临的问题是,如果五个视图之一比下一个视图更多的文字,还有空的滚动空间。
Each view is placed inside a ScrollView in a TextSwitcher. The problem that I am facing is that if one of the five views has more text than the next view, there is empty scroll space.
我如何能摆脱这种空间的任何想法?
Any ideas on how I can get rid of this space?
谢谢!
推荐答案
TextSwitcher,因为任何ViewSwitcher / ViewAnimator将大小默认最大的子大小。
TextSwitcher, as any ViewSwitcher/ViewAnimator will size to the largest child size by default.
这可以通过MeasureAllChildren属性设置为false,例如改变:
This can be changed by setting the MeasureAllChildren property to false, e.g.:
TextSwitcher switcher = (TextSwitcher)findViewById(R.id.textSwitcher);
switcher.setMeasureAllChildren(false);
那么大小将调整为布局上的可视子。
Then the size will be adjusted to the visible child on layout.
这篇关于在文本转换器摆脱额外的空间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!