问题:
在ScrollView中一个View中的内容是需要从网络上获取的,获取到内容后填充进View中,此时ScrollView内部控件的长度会发生改变,导致ScrollView自动滚动。影响整体效果。
解决办法:
<ScrollView
android:id="@+id/quote_colligate_scrollView"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#F6F6F8" >
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:focusable="true"
android:focusableInTouchMode="true">
。。。。。。。
</LinearLayout>
</ScrollView>
如布局文件所示:在ScrollView下对应的LinearLayout中加入
android:focusable="true"
android:focusableInTouchMode="true"
将焦点给LinearLayout就不会因为内部控件的改变而导致ScrollView的滚动