【发布时间】:2014-07-03 23:01:58
【问题描述】:
我有一个 ScrollView,它正在工作,我能够到达底部并返回顶部。 问题是当用户将手指从屏幕上移开时,滚动会立即停止。它应该更顺畅,不会累到底部。谁能帮帮我?
这是我的代码:
XML:
<ScrollView
android:id="@+id/home_content_container"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="start"
android:background="@color/color_background_default"
android:fadingEdgeLength="@dimen/app_fading_edge_length" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/color_background_default"
android:orientation="vertical"
android:padding="@dimen/app_content_padding" >
<!-- Lots of different components here -->
</LinearLayout>
</ScrollView>
我试着做
scrollView.setSmoothScrollingEnabled(true);
但这也没有用。
另外,我展示了一些在滚动视图的主要内容被渲染后异步获取的内容。其中一些是图像,可能会影响滚动的总高度......想想我这样做了
scrollView.refreshDrawableState();
scrollView.requestLayout();
这根本不起作用......
【问题讨论】:
标签: android scrollview smooth-scrolling