Android的滚动型滚动到底 [英] Android ScrollView Scroll to Bottom
问题描述
的滚动型
在Android是真正的混乱。我的工作,增加了文字到的TextView
中的滚动型
,我想这一个片段的应用滚动至底部的滚动型
。
The ScrollView
in Android is really confusing. I'm working on an app that adds a fragment of text to a TextView
inside the ScrollView
, and I want it to scroll to the bottom of the ScrollView
.
我已经尝试以下方式:
Scroll1.fullScroll(View.FOCUS_DOWN);
Scroll1.scrollTo(0,sv.getBottom());
Scroll1.scrollTo(0,Scroll1.getY()+ Scroll1.getHeight());
请注意:
1. Scroll1是我使用了滚动型
。 2.前两种方法不能滚动至底部。最后是行不通的。
NOTE:
1. Scroll1 is the ScrollView
I used. 2. The first two methods can't scroll to the bottom. The last just doesn't work.
我怎样才能做到这一点?请帮忙。谢谢你。
How can I achieve this? Please help. Thanks.
推荐答案
试试这个它可能会帮助,如果我知道你的问题:
粘贴滚动视图中的XML
try this it may helps if I know your problem: paste it in scroll view in xml
android:fillViewport="true"
或
在Java活动
scrollView.setFillViewport(true);
这篇关于Android的滚动型滚动到底的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!