我在ScrollView中有一个childView,它扩展了onClick。我使用以下代码在屏幕上完全显示了展开的视图。
scrollView.requestChildFocus(childView, focussedView);
但是滚动不平滑。我该怎么做才能使滚动平滑?
答案 0 :(得分:0)
您可以使用smooth scroll
提供的ScrollView
方法。这是documentation。
尝试以下方法:
public void setSmoothScrollingEnabled(boolean smoothScrollingEnabled)
// Set whether arrow scrolling will animate its transition.
public final void smoothScrollTo(int x, int y)
// Like scrollTo(int, int), but scroll smoothly instead of immediately.
public final void smoothScrollBy(int dx, int dy)
// Like View.scrollBy(int, int), but scroll smoothly instead of immediately.