ListView控件clicklisteners [英] ListView clicklisteners

查看:81
本文介绍了ListView控件clicklisteners的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个列表视图其中有几个在它的观点,我有一个的TextView 的ImageView

我需要做的是,我希望有一个人可以点击刚上的ImageView ,而不会导致 onItemClicked 函数被调用,如果对方点击的ImageView ,它应该做别的事情,但如果这个人点击即可(除了 ImageView的)从的ImageView ,那么 onItemClicked 被激发。

我如何做到这一点?

这是有点像,在的ListView 在Android手机 callLogs 其中,绿色的电话图标以某种方式分离从列表中,但点击时,就应该知道哪些的listItem 被选中,并采取相应的行动。

我会AP preciate的帮助。谢谢你。

解决方案

下面是一些链接,你正在寻找。先进的,但如果你坚持它,不要放弃,你会学到一吨!请看下图:

<一个href="http://stackoverflow.com/questions/1709166/android-listview-elements-with-multiple-clickable-buttons">Android: ListView的元素有多个可单击按钮

的Andr​​oid与嵌套小部件 <自定义列表项/ P>

I have a list view which has a couple of views within it, I have a textView and an ImageView.

What I need to do is, I want a person to be able to click just on the imageView without causing the onItemClicked function to be invoked, If the person clicks the ImageView, it should do something else, but if the person clicks away(apart from the imageview) from the imageView, then the onItemClicked is fired.

How do I do this?

It is kinda like, the listView on the android phone callLogs whereby, the green phone icon is somehow separated from the list but when clicked, it should know which listItem was selected and act accordingly.

I will appreciate the help. Thanks.

解决方案

Here are some links for you are looking for. Advanced but if you stick with it and dont give up on this, you will learn a ton!!! Take a look:

Android: ListView elements with multiple clickable buttons

Android custom list item with nested widgets

这篇关于ListView控件clicklisteners的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆