ListView setOnItemClickListener无法响应点击事件解决
写了个ListView,adapter是implement ListAdapter的,发现无法点击。上网查了资料,
1) 如果item当中包括checkbox和button等响应事件的view,那么就不会响应item的点击,把子view设置为不可focus就OK
2) 设置了还是没有用,看到网上一哥们写的
my problem is now solved and I just want to report the solution, in
case someone else is finding the same problem.
My implementation of ListAdapter.isEnabled was returning false, which
of course should have returned true. Shame on me, very stupid mistake.
检查了一遍,果然!!我也是这个低级错误,实现接口的时候默认是false的
@Override
public boolean isEnabled(int position)
{
// TODO Auto-generated method stub
return false;
}
都disable了,怎么可能响应呢? 改成true,问题解决~~~~鼓掌
posted on 2012-03-06 11:13 lightideal 阅读(1746) 评论(0) 编辑 收藏 举报