有办法监听scroll-view滑动结束吗?求大神指教~~~

发布于 7 年前作者 qiangli10697 次浏览最后编辑 7 年前来自 ask

scroll-view有个bindscroll事件但是在这个事件里面setData会造成页面一直刷~~有办法监听scroll-view滑动结束后再setData吗?

5 回复
tao42
tao421 楼6 年前

@赵子龙    稳

guiyingwu
guiyingwu2 楼6 年前

    你搞个定时器不就行了

bindscroll: function () {

    clearTimeout(this.timeoutId);

    this.timeoutId = setTimeout(function () {

        this.setData({

            name: “赵子龙”

        });

        delete this.timeoutId;

    }.bind(this), 500);

}

gyin
gyin3 楼6 年前

bindscrolltolower这个事件是滑到底部的~不是滑动结束的~~

mingfeng
mingfeng4 楼6 年前

好的~谢谢@赵子龙

junchen
junchen5 楼5 年前

bindscrolltolower