滚动视图中的多个textview [英] multiple textviews in a scrollview
问题描述
我有一个活动,正在将步行路线显示为文本.我有一组TextView,其中5个包含步骤x",其中x是步骤编号,另外5个包含实际指令的TextView.
I have an activity which is displaying walking directions as text. I have a group of TextViews, 5 contain "Step x" where x is the step number and 5 more TextViews which contain the actual instructions.
问题是最后一个TextView消失了,所以我想让这组TextView像它们一样滚动.这可能吗?我知道ScrollView似乎只有一个TextView作为孩子.
The problem is that the last TextView goes of screen so I want to have the group of TextViews scroll as if they're one. Is this possible? I know ScrollView seems to only take one TextView as a child.
我本来打算将所有文本都放在一个TextView中,但是我无法将样式分别应用于"Step x"文本.
I was thinking of having all the text in one TextView however I would not be able to apply styling to the "Step x" text individually.
推荐答案
您可以将所有文本视图放入LinearLayout中,然后将该布局放入ScrollView中.
You can just put all your text views into a LinearLayout and then put that layout into the ScrollView.
这篇关于滚动视图中的多个textview的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!