不能触发onClickListener与linkfied TextViews一个的LinearLayout [英] Cannot trigger onClickListener on a LinearLayout with linkfied TextViews

查看:189
本文介绍了不能触发onClickListener与linkfied TextViews一个的LinearLayout的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一个列表视图,其中每个细胞里面它的其他意见的LinearLayout。我还建立了细胞的onClickListener采取用户到另一个活动。

I'm developing a list view in which each cell is a LinearLayout with other views inside it. I have also set the onClickListener of the cells to take the user to another Activity.

问题是,一个视图里面是我套用Linkify功能一个TextView。当TextView中恰好有在其文本的链接,我不能触发onClickListener了,除非我点击的LinearLayout的另一种观点。这个问题也适用于突出显示功能。

The problem is that one of the views inside is a TextView in which I apply the Linkify function. When the TextView happens to have a link in its text, I cannot trigger the onClickListener anymore, unless I click on another view of the LinearLayout. This problem also applies to the highlighting feature.

有谁知道什么可能会发生?

Does anyone knows what may be happening?

谢谢!

推荐答案

如果你申请你的getView()覆盖内的Linkify功能,我就在想,如果它只是自动设置上的观点作为可点击式的方法传递给它。 Linkify之后,你可以尝试调用setClickable(假),setFocusable(假),setFocusableInTouchMode(假)都在,这是Linkified的看法。

If you are applying the Linkify function inside of your getView() Override, I would wonder if it's just automatically setting the "Clickable" type methods on the view being passed to it. Right after Linkify, you could try calling setClickable(false), setFocusable(false), setFocusableInTouchMode(false) all on the view that was Linkified.

这篇关于不能触发onClickListener与linkfied TextViews一个的LinearLayout的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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