本文介绍了如何通过OnItemClickListener使imageView可点击?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
lv.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(final AdapterView<?> parent, View view, final int position, long id)
{
// My code is here. I want make my image clickable. I don't want make it clickable in my CustomAdapter getView() method because it doesn't allows me open DialogFragment from there.
// I already setted in xml of image clickable="true" and focusable = "false"
//I'll admit for any help and thanks in advance
}
}
推荐答案
如果从适配器获取图像Onclick,则不能从listview事件中获取setOnItemClickListener.我建议您可以使用Onclick,而不是setOnItemClickListener从适配器获取Onclick.
If you take image Onclick from adapter,you cannot take setOnItemClickListener from listview event.I suggested you may take Onclick and insteadof setOnItemClickListener take Onclick from adapter.
这篇关于如何通过OnItemClickListener使imageView可点击?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!