SpringView icon indicating copy to clipboard operation
SpringView copied to clipboard

SpringView.callFresh()方法无效?

Open youyuanme opened this issue 7 years ago • 5 comments

SpringView.callFresh()方法无效? 需求是想在进入activity时自动显示下拉刷新,并且可以回调下面的onRefresh()方法。 mSpringView.setListener(new SpringView.OnFreshListener() { @Override public void onRefresh() { } @Override public void onLoadmore() { } });

youyuanme avatar Sep 01 '17 06:09 youyuanme

你一定是在onCreate方法里调用的吧,Activity在onCreate的时候View是不能执行动画的,一定要在onCreate中调用就加个延时吧 new Handler().postDelayed(new Runnable() { @Override public void run() { springView.callFresh(); } },100);

liaoinstan avatar Sep 01 '17 08:09 liaoinstan

onResume()方法中可以执行view动画吗?

youyuanme avatar Sep 01 '17 09:09 youyuanme

just use it , no thanks !!!

override fun onViewCreated(view: View?, savedInstanceState: Bundle?) {
        super.onViewCreated(view, savedInstanceState)

        Looper.myQueue().addIdleHandler {
                spring_view.callFresh()
                false
        }

}

krmao avatar Nov 16 '17 03:11 krmao

我也遇到了,并不是在onCreate中调用的,加延时也没用

ycyz97 avatar Jun 10 '18 08:06 ycyz97

我也遇到了,并不是在onCreate中调用的,加延时也没用

延时没加够,不然就是代码问题

Itachi6688 avatar Dec 03 '18 02:12 Itachi6688