本文介绍了setOnScrollListener与setOnItemClickListener的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
listView.setAdapter(adapter);
listView.setOnScrollListener(this);
listView.setOnItemClickListener(this);
我对片段,自定义适配器的ListView,我想设置就可以了2监听器,但是当我加入 setOnScrollListener
第一监听器不工作。怎么了?我怎样才能解决这个问题?
I have listView on fragment, custom adapter and I want to set 2 listeners on it, but when I added setOnScrollListener
first listener doesn't work. What's wrong? and how can I fix it?
推荐答案
我有同样的问题,这似乎是由一个错位 adapter.notifyDataSetChanged()
调用会导致。删除此行解决了这一问题,因为它变成了我没必要也无妨。
I had the same problem, which seemed to be caused by a misplaced adapter.notifyDataSetChanged()
call. Removing this line fixed the problem, as it turned out I didn't need it anyway.
这篇关于setOnScrollListener与setOnItemClickListener的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!