PullToRefreshScrollView 使用scrollTo本打算 移动内部视角。。但是发现直接引起 PullToRefreshScrollView 发生位移 。。代码应该是没有错啊 。。后来借助了别人的介绍。解决了。。原文地址是: http://blog.youkuaiyun.com/leibinleibin/article/details/29862347
原因是:PullToRefreshScrollView这个组件的bug 。
在项目中使用了开源的com.handmark.pulltorefresh.library 下拉刷新组件,其中使用了PullToRefreshScrollView ,需要调用scrollTo或者scrollBy滑动到指定的位置。
直接使用PullToRefreshScrollView .scrollTo方法发现会有bug,查了下代码发现是view的方法。调用
final ScrollViewscrollView = PullToRefreshScrollView.getRefreshableView();
scrollView.post(new Runnable() {
@Override
public void run() {
scrollView.scrollTo(0,100);
}
});
问题解决